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 06881a99a2..6eddd4e09a 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 @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlan; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanCollection; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanPatch; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicyPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServer; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerConsoleAccessToken; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDisk; @@ -172,6 +173,7 @@ import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerClientOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerRouteOptions; +import com.ibm.cloud.is.vpc.v1.model.DeprecateImageOptions; import com.ibm.cloud.is.vpc.v1.model.DisconnectVpnClientOptions; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.EndpointGateway; @@ -319,7 +321,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePatch; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImage; 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.Key; @@ -437,6 +439,7 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePatch; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceUnpaginatedCollection; +import com.ibm.cloud.is.vpc.v1.model.ObsoleteImageOptions; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemIdentityByName; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemsPager; @@ -449,6 +452,7 @@ import com.ibm.cloud.is.vpc.v1.model.PublicGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.Region; import com.ibm.cloud.is.vpc.v1.model.RegionCollection; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByName; import com.ibm.cloud.is.vpc.v1.model.RemoveBareMetalServerNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveEndpointGatewayIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveInstanceNetworkInterfaceFloatingIpOptions; @@ -461,6 +465,7 @@ import com.ibm.cloud.is.vpc.v1.model.ReservedIPPatch; import com.ibm.cloud.is.vpc.v1.model.RestartBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.Route; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextRoutesItem; import com.ibm.cloud.is.vpc.v1.model.RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP; import com.ibm.cloud.is.vpc.v1.model.RoutePatch; import com.ibm.cloud.is.vpc.v1.model.RoutingTable; @@ -479,7 +484,9 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotClone; import com.ibm.cloud.is.vpc.v1.model.SnapshotCloneCollection; import com.ibm.cloud.is.vpc.v1.model.Snapshot; +import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.SnapshotPatch; +import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.SnapshotsPager; import com.ibm.cloud.is.vpc.v1.model.StartBareMetalServerOptions; @@ -673,10 +680,13 @@ public class VPCExamples { static String vpnGatewayId; static String vpnGatewayConnectionId; static String regionName = "us-east"; + static String crossRegionName = "us-south"; static String securityGroupId; static String securityGroupRuleId; static String securityGroupTargetId; static String snapshotId; + static String snapshotCopyCRN; + static String snapshotCopyId; static String sourceVolume; static String targetId; static String zoneName = "us-east-1"; @@ -688,9 +698,13 @@ public class VPCExamples { static String backupPolicyId; static String backupPolicyJobId; static String backupPolicyPlanId; + static String backupPolicyRemoteCopyPlanId; static String ifMatchBackupPolicy; static String ifMatchBackupPolicyPlan; + static String ifMatchBackupPolicyRemoteCopyPlan; static String ifMatchVpnServer; + static String ifMatchSnapshot; + static String ifMatchSnapshotCopy; static String vpnServerId; static String vpnServerClientId; static String vpnServerRouteId; @@ -919,9 +933,9 @@ public static void main(String[] args) throws Exception { .build(); VpcRoutesPager pager = new VpcRoutesPager(vpcService, listVpcRoutesOptions); - List allResults = new ArrayList<>(); + List allResults = new ArrayList<>(); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); allResults.addAll(nextPage); } @@ -950,7 +964,6 @@ public static void main(String[] args) throws Exception { .build(); Response response = vpcService.createVpcRoute(createVpcRouteOptions).execute(); Route route = response.getResult(); - // end-create_vpc_route vpcRouteId = route.getId(); } catch (ServiceResponseException e) { @@ -968,7 +981,6 @@ public static void main(String[] args) throws Exception { Response response = vpcService.getVpcRoute(getVpcRouteOptions).execute(); Route route = response.getResult(); - // end-get_vpc_route } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", @@ -990,7 +1002,6 @@ public static void main(String[] args) throws Exception { Response response = vpcService.updateVpcRoute(updateVpcRouteOptions).execute(); Route route = response.getResult(); - // end-update_vpc_route } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", @@ -1621,6 +1632,32 @@ public static void main(String[] args) throws Exception { e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); } + + try { + // begin-deprecate_image + DeprecateImageOptions deprecateImageOptions = new DeprecateImageOptions.Builder() + .id(imageId) + .build(); + + Response response = vpcService.deprecateImage(deprecateImageOptions).execute(); + // end-deprecate_image + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } + + try { + // begin-obsolete_image + ObsoleteImageOptions obsoleteImageOptions = new ObsoleteImageOptions.Builder() + .id(imageId) + .build(); + + Response response = vpcService.obsoleteImage(obsoleteImageOptions).execute(); + // end-obsolete_image + } catch (ServiceResponseException e) { + logger.error(String.format("Service returned status code %s: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); + } try { System.out.println("listImageExportJobs() result:"); // begin-list_image_export_jobs @@ -1843,7 +1880,7 @@ public static void main(String[] args) throws Exception { ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name(zoneName) .build(); - InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.Builder() + InstanceTemplatePrototypeInstanceTemplateByImage instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceTemplateByImage.Builder() .keys(new java.util.ArrayList(java.util.Arrays.asList(keyIdentityModel))) .name("my-instance-template") .profile(instanceProfileIdentityModel) @@ -2081,6 +2118,20 @@ public static void main(String[] args) throws Exception { try { System.out.println("createBackupPolicyPlan() result:"); // begin-create_backup_policy_plan + RegionIdentityByName regionIdentityByName = new RegionIdentityByName.Builder(crossRegionName).build(); + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototype = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .region(regionIdentityByName) + .build(); + CreateBackupPolicyPlanOptions createBackupPolicyPlanRemoteCopyOptions = new CreateBackupPolicyPlanOptions.Builder() + .backupPolicyId(backupPolicyId) + .name("my-backup-policy-plan-remote-copy") + .cronSpec("*/5 1,2,3 * * *") + .remoteRegionPolicies(Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototype)) + .build(); + + Response remoteCopyResponse = vpcService.createBackupPolicyPlan(createBackupPolicyPlanRemoteCopyOptions).execute(); + BackupPolicyPlan backupPolicyRemoteCopyPlan = remoteCopyResponse.getResult(); + CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions = new CreateBackupPolicyPlanOptions.Builder() .backupPolicyId(backupPolicyId) .name("my-backup-policy-plan") @@ -2093,6 +2144,8 @@ public static void main(String[] args) throws Exception { // end-create_backup_policy_plan backupPolicyPlanId = backupPolicyPlan.getId(); ifMatchBackupPolicyPlan = response.getHeaders().values("etag").get(0); + backupPolicyRemoteCopyPlanId = backupPolicyRemoteCopyPlan.getId(); + ifMatchBackupPolicyRemoteCopyPlan = remoteCopyResponse.getHeaders().values("etag").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", @@ -3990,7 +4043,25 @@ public static void main(String[] args) throws Exception { Response response1 = vpcService.createSnapshot(createSnapshotOptions1).execute(); Snapshot snapshot1 = response1.getResult(); + + snapshotCopyCRN = snapshot1.getCrn(); // begin-create_snapshot + + SnapshotIdentityByCRN snapshotIdentityByCRN = new SnapshotIdentityByCRN.Builder() + .crn(snapshotCopyCRN) + .build(); + SnapshotPrototypeSnapshotBySourceSnapshot snapshotPrototypeCopyModel = new SnapshotPrototypeSnapshotBySourceSnapshot.Builder() + .sourceSnapshot(snapshotIdentityByCRN) + .name("my-snapshot-copy") + .build(); + CreateSnapshotOptions createSnapshotCopyOptions = new CreateSnapshotOptions.Builder() + .snapshotPrototype(snapshotPrototypeCopyModel) + .build(); + + Response responsesnapshotcopy = vpcService.createSnapshot(createSnapshotCopyOptions).execute(); + Snapshot snapshotcopy = responsesnapshotcopy.getResult(); + + VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() .id(sourceVolume) .build(); @@ -4006,6 +4077,8 @@ public static void main(String[] args) throws Exception { Snapshot snapshot = response.getResult(); // end-create_snapshot + snapshotCopyId = snapshotcopy.getId(); + ifMatchSnapshotCopy = responsesnapshotcopy.getHeaders().values("etag").get(0); snapshotId = snapshot.getId(); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", @@ -4023,6 +4096,7 @@ public static void main(String[] args) throws Exception { Snapshot snapshot = response.getResult(); // end-get_snapshot + ifMatchSnapshotCopy = response.getHeaders().values("etag").get(0); } catch (ServiceResponseException e) { logger.error(String.format("Service returned status code %s: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e); @@ -6374,9 +6448,17 @@ public static void main(String[] args) throws Exception { } try { + DeleteSnapshotOptions deleteSnapshotCopyOptions = new DeleteSnapshotOptions.Builder() + .id(snapshotCopyId) + .ifMatch(ifMatchSnapshotCopy) + .build(); + + Response responseCopy = vpcService.deleteSnapshot(deleteSnapshotCopyOptions).execute(); + System.out.printf("deleteSnapshot() copy response status code: %d%n", responseCopy.getStatusCode()); // begin-delete_snapshot DeleteSnapshotOptions deleteSnapshotOptions = new DeleteSnapshotOptions.Builder() .id(snapshotId) + .ifMatch(ifMatchSnapshotCopy) .build(); Response response = vpcService.deleteSnapshot(deleteSnapshotOptions).execute(); @@ -6899,6 +6981,15 @@ public static void main(String[] args) throws Exception { try { System.out.println("deleteBackupPolicyPlan() result:"); + DeleteBackupPolicyPlanOptions deleteBackupPolicyRemoteCopyPlanOptions = new DeleteBackupPolicyPlanOptions.Builder() + .backupPolicyId(backupPolicyId) + .id(backupPolicyRemoteCopyPlanId) + .ifMatch(ifMatchBackupPolicyRemoteCopyPlan) + .build(); + + Response remoteCopyResponse = vpcService.deleteBackupPolicyPlan(deleteBackupPolicyRemoteCopyPlanOptions).execute(); + BackupPolicyPlan backupPolicyRemoteCopyPlan = remoteCopyResponse.getResult(); + System.out.printf("deleteBackupPolicyPlan() remote copy response status code: %d%n", remoteCopyResponse.getStatusCode()); // begin-delete_backup_policy_plan DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptions = new DeleteBackupPolicyPlanOptions.Builder() .backupPolicyId(backupPolicyId) 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 4c9aea44db..3ff627acce 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.69.0-370d6400-20230329-174648 + * IBM OpenAPI SDK Code Generator Version: 3.70.0-7df966bf-20230419-195904 */ package com.ibm.cloud.is.vpc.v1; @@ -161,6 +161,7 @@ import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerClientOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerRouteOptions; +import com.ibm.cloud.is.vpc.v1.model.DeprecateImageOptions; 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; @@ -371,6 +372,7 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleCollection; import com.ibm.cloud.is.vpc.v1.model.NetworkInterface; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceUnpaginatedCollection; +import com.ibm.cloud.is.vpc.v1.model.ObsoleteImageOptions; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemCollection; import com.ibm.cloud.is.vpc.v1.model.PlacementGroup; @@ -394,6 +396,7 @@ import com.ibm.cloud.is.vpc.v1.model.RestartBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.Route; import com.ibm.cloud.is.vpc.v1.model.RouteCollection; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContext; import com.ibm.cloud.is.vpc.v1.model.RoutingTable; import com.ibm.cloud.is.vpc.v1.model.RoutingTableCollection; import com.ibm.cloud.is.vpc.v1.model.SecurityGroup; @@ -491,6 +494,7 @@ import com.ibm.cloud.sdk.core.security.Authenticator; import com.ibm.cloud.sdk.core.security.ConfigBasedAuthenticatorFactory; import com.ibm.cloud.sdk.core.service.BaseService; +import com.ibm.cloud.sdk.core.util.RequestUtils; import com.ibm.cloud.sdk.core.util.ResponseConverterUtils; import java.util.HashMap; import java.util.Map; @@ -501,7 +505,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: 2022-09-13 + * API Version: `2023-07-11` */ public class Vpc extends BaseService { private static final Logger LOGGER = Logger.getLogger(Vpc.class.getName()); @@ -518,7 +522,7 @@ public class Vpc extends BaseService { private Long generation = Long.valueOf("2"); - private String version = "2022-09-13"; + private String version = "2023-07-11"; /** * Class method which constructs an instance of the `Vpc` client. @@ -582,7 +586,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 - * `2022-09-13` and today's date (UTC). + * `2022-09-13` and `2023-07-11`. * * @return the version */ @@ -764,7 +768,8 @@ public ServiceCall getVpc(GetVpcOptions getVpcOptions) { /** * Update a VPC. * - * This request updates a VPC's name. + * 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 updateVpcOptions the {@link UpdateVpcOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link VPC} @@ -1029,11 +1034,11 @@ public ServiceCall updateVpcAddressPrefix(UpdateVpcAddressPrefixO * destination will be used. If multiple equally-specific routes exist, traffic will be distributed across them. * * @param listVpcRoutesOptions the {@link ListVpcRoutesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RouteCollection} + * @return a {@link ServiceCall} with a result of type {@link RouteCollectionVPCContext} * @deprecated this method is deprecated and may be removed in a future release */ @Deprecated - public ServiceCall listVpcRoutes(ListVpcRoutesOptions listVpcRoutesOptions) { + 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"); @@ -1056,8 +1061,8 @@ public ServiceCall listVpcRoutes(ListVpcRoutesOptions listVpcRo if (listVpcRoutesOptions.limit() != null) { builder.query("limit", String.valueOf(listVpcRoutesOptions.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); } @@ -2058,9 +2063,6 @@ public ServiceCall updateSubnetReservedIp(UpdateSubnetReservedIpOpti * This request lists all 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. * - * The images will be sorted by their `created_at` property values, with the newest first. Images with identical - * `created_at` values will be secondarily sorted by ascending `id` property values. - * * @param listImagesOptions the {@link ListImagesOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ImageCollection} */ @@ -2088,6 +2090,9 @@ public ServiceCall listImages(ListImagesOptions listImagesOptio 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())); } @@ -2102,9 +2107,6 @@ public ServiceCall listImages(ListImagesOptions listImagesOptio * This request lists all 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. * - * The images will be sorted by their `created_at` property values, with the newest first. Images with identical - * `created_at` values will be secondarily sorted by ascending `id` property values. - * * @return a {@link ServiceCall} with a result of type {@link ImageCollection} */ public ServiceCall listImages() { @@ -2222,6 +2224,74 @@ public ServiceCall updateImage(UpdateImageOptions updateImageOptions) { 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. + * + * The image must: + * - have a `status` of `available` + * - have `catalog_offering.managed` set to `false` + * - not have `deprecation_at` set + * + * The image must not have `deprecation_at` set, must have `catalog_offering.managed` set to + * `false`, and must have a `status` of `available`. + * + * A system-provided image 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 deprecateImage(DeprecateImageOptions deprecateImageOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deprecateImageOptions, + "deprecateImageOptions 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"); + 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); + } + + /** + * Obsolete an image. + * + * This request obsoletes an image, resulting in its `status` becoming `obsolete` and + * `obsolescence_at` being set to the current date and time. + * + * 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 + * + * A system-provided image 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 + */ + 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", 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()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + /** * List all image export jobs. * @@ -2992,8 +3062,8 @@ public ServiceCall updateInstance(UpdateInstanceOptions updateInstance /** * Retrieve initialization configuration for an instance. * - * This request retrieves configuration variables used to initialize the instance, such as SSH keys and the Windows - * administrator password. + * 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 getInstanceInitializationOptions the {@link GetInstanceInitializationOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link InstanceInitialization} @@ -5131,6 +5201,9 @@ public ServiceCall createBackupPolicyPlan(CreateBackupPolicyPl 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()); @@ -6183,9 +6256,9 @@ public ServiceCall updateBareMetalServer(UpdateBareMetalServerO /** * Retrieve initialization configuration for a bare metal server. * - * This request retrieves configuration variables used to initialize the bare metal server, such as the image used, - * SSH keys, and any configured usernames and passwords. These attributes can subsequently be changed manually by the - * user and so are not guaranteed to be current. + * 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} @@ -6604,6 +6677,30 @@ public ServiceCall listSnapshots(ListSnapshotsOptions listSn 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())); } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AccountReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AccountReference.java new file mode 100644 index 0000000000..cd3e55f848 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AccountReference.java @@ -0,0 +1,59 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * AccountReference. + */ +public class AccountReference extends GenericModel { + + /** + * The resource type. + */ + public interface ResourceType { + /** account. */ + String ACCOUNT = "account"; + } + + protected String id; + @SerializedName("resource_type") + protected String resourceType; + + protected AccountReference() { } + + /** + * Gets the id. + * + * The unique identifier for this account. + * + * @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/BackupPolicyJobSource.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSource.java index e06e403cd4..43f13b5081 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSource.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSource.java @@ -12,6 +12,7 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; /** @@ -23,11 +24,22 @@ */ public class BackupPolicyJobSource extends GenericModel { + /** + * The resource type. + */ + public interface ResourceType { + /** volume. */ + String VOLUME = "volume"; + } + protected String crn; protected VolumeReferenceDeleted deleted; protected String href; protected String id; protected String name; + protected VolumeRemote remote; + @SerializedName("resource_type") + protected String resourceType; protected BackupPolicyJobSource() { } @@ -86,5 +98,28 @@ public String getId() { public String getName() { return name; } + + /** + * Gets the remote. + * + * If present, this property indicates that the resource associated with this reference + * is remote and therefore may not be directly retrievable. + * + * @return the remote + */ + public VolumeRemote getRemote() { + return remote; + } + + /** + * 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/BackupPolicyJobSourceVolumeReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceVolumeReference.java index 1b5db470e8..c81db66795 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceVolumeReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceVolumeReference.java @@ -17,6 +17,14 @@ */ public class BackupPolicyJobSourceVolumeReference extends BackupPolicyJobSource { + /** + * The resource type. + */ + public interface ResourceType { + /** volume. */ + String VOLUME = "volume"; + } + protected BackupPolicyJobSourceVolumeReference() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlan.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlan.java index 11e4adf501..a3b60c3087 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlan.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlan.java @@ -69,6 +69,8 @@ public interface ResourceType { @SerializedName("lifecycle_state") protected String lifecycleState; protected String name; + @SerializedName("remote_region_policies") + protected List remoteRegionPolicies; @SerializedName("resource_type") protected String resourceType; @@ -195,6 +197,17 @@ public String getName() { return name; } + /** + * Gets the remoteRegionPolicies. + * + * The policies for additional backups in remote regions. + * + * @return the remoteRegionPolicies + */ + public List getRemoteRegionPolicies() { + return remoteRegionPolicies; + } + /** * Gets the resourceType. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatch.java index 063c6921e2..e0dd87bd84 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatch.java @@ -37,6 +37,8 @@ public class BackupPolicyPlanPatch extends GenericModel { @SerializedName("deletion_trigger") protected BackupPolicyPlanDeletionTriggerPatch deletionTrigger; protected String name; + @SerializedName("remote_region_policies") + protected List remoteRegionPolicies; /** * Builder. @@ -49,6 +51,7 @@ public static class Builder { private String cronSpec; private BackupPolicyPlanDeletionTriggerPatch deletionTrigger; private String name; + private List remoteRegionPolicies; /** * Instantiates a new Builder from an existing BackupPolicyPlanPatch instance. @@ -63,6 +66,7 @@ private Builder(BackupPolicyPlanPatch backupPolicyPlanPatch) { this.cronSpec = backupPolicyPlanPatch.cronSpec; this.deletionTrigger = backupPolicyPlanPatch.deletionTrigger; this.name = backupPolicyPlanPatch.name; + this.remoteRegionPolicies = backupPolicyPlanPatch.remoteRegionPolicies; } /** @@ -96,6 +100,22 @@ public Builder addAttachUserTags(String attachUserTags) { return this; } + /** + * Adds an remoteRegionPolicies to remoteRegionPolicies. + * + * @param remoteRegionPolicies the new remoteRegionPolicies + * @return the BackupPolicyPlanPatch builder + */ + public Builder addRemoteRegionPolicies(BackupPolicyPlanRemoteRegionPolicyPrototype remoteRegionPolicies) { + com.ibm.cloud.sdk.core.util.Validator.notNull(remoteRegionPolicies, + "remoteRegionPolicies cannot be null"); + if (this.remoteRegionPolicies == null) { + this.remoteRegionPolicies = new ArrayList(); + } + this.remoteRegionPolicies.add(remoteRegionPolicies); + return this; + } + /** * Set the active. * @@ -173,6 +193,18 @@ public Builder name(String name) { this.name = name; return this; } + + /** + * Set the remoteRegionPolicies. + * Existing remoteRegionPolicies will be replaced. + * + * @param remoteRegionPolicies the remoteRegionPolicies + * @return the BackupPolicyPlanPatch builder + */ + public Builder remoteRegionPolicies(List remoteRegionPolicies) { + this.remoteRegionPolicies = remoteRegionPolicies; + return this; + } } protected BackupPolicyPlanPatch() { } @@ -185,6 +217,7 @@ protected BackupPolicyPlanPatch(Builder builder) { cronSpec = builder.cronSpec; deletionTrigger = builder.deletionTrigger; name = builder.name; + remoteRegionPolicies = builder.remoteRegionPolicies; } /** @@ -274,6 +307,17 @@ public String name() { return name; } + /** + * Gets the remoteRegionPolicies. + * + * The policies for additional backups in remote regions (replacing any existing policies). + * + * @return the remoteRegionPolicies + */ + public List remoteRegionPolicies() { + return remoteRegionPolicies; + } + /** * Construct a JSON merge-patch from the BackupPolicyPlanPatch. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototype.java index cb605f5dfc..a034d38684 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototype.java @@ -35,6 +35,8 @@ public class BackupPolicyPlanPrototype extends GenericModel { @SerializedName("deletion_trigger") protected BackupPolicyPlanDeletionTriggerPrototype deletionTrigger; protected String name; + @SerializedName("remote_region_policies") + protected List remoteRegionPolicies; /** * Builder. @@ -47,6 +49,7 @@ public static class Builder { private String cronSpec; private BackupPolicyPlanDeletionTriggerPrototype deletionTrigger; private String name; + private List remoteRegionPolicies; /** * Instantiates a new Builder from an existing BackupPolicyPlanPrototype instance. @@ -61,6 +64,7 @@ private Builder(BackupPolicyPlanPrototype backupPolicyPlanPrototype) { this.cronSpec = backupPolicyPlanPrototype.cronSpec; this.deletionTrigger = backupPolicyPlanPrototype.deletionTrigger; this.name = backupPolicyPlanPrototype.name; + this.remoteRegionPolicies = backupPolicyPlanPrototype.remoteRegionPolicies; } /** @@ -103,6 +107,22 @@ public Builder addAttachUserTags(String attachUserTags) { return this; } + /** + * Adds an remoteRegionPolicies to remoteRegionPolicies. + * + * @param remoteRegionPolicies the new remoteRegionPolicies + * @return the BackupPolicyPlanPrototype builder + */ + public Builder addRemoteRegionPolicies(BackupPolicyPlanRemoteRegionPolicyPrototype remoteRegionPolicies) { + com.ibm.cloud.sdk.core.util.Validator.notNull(remoteRegionPolicies, + "remoteRegionPolicies cannot be null"); + if (this.remoteRegionPolicies == null) { + this.remoteRegionPolicies = new ArrayList(); + } + this.remoteRegionPolicies.add(remoteRegionPolicies); + return this; + } + /** * Set the active. * @@ -180,6 +200,18 @@ public Builder name(String name) { this.name = name; return this; } + + /** + * Set the remoteRegionPolicies. + * Existing remoteRegionPolicies will be replaced. + * + * @param remoteRegionPolicies the remoteRegionPolicies + * @return the BackupPolicyPlanPrototype builder + */ + public Builder remoteRegionPolicies(List remoteRegionPolicies) { + this.remoteRegionPolicies = remoteRegionPolicies; + return this; + } } protected BackupPolicyPlanPrototype() { } @@ -194,6 +226,7 @@ protected BackupPolicyPlanPrototype(Builder builder) { cronSpec = builder.cronSpec; deletionTrigger = builder.deletionTrigger; name = builder.name; + remoteRegionPolicies = builder.remoteRegionPolicies; } /** @@ -282,5 +315,16 @@ public BackupPolicyPlanDeletionTriggerPrototype deletionTrigger() { public String name() { return name; } + + /** + * Gets the remoteRegionPolicies. + * + * The policies for additional backups in remote regions. + * + * @return the remoteRegionPolicies + */ + public List remoteRegionPolicies() { + return remoteRegionPolicies; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReference.java index 526787319a..b0d0e52d7e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReference.java @@ -32,6 +32,7 @@ public interface ResourceType { protected String href; protected String id; protected String name; + protected BackupPolicyPlanRemote remote; @SerializedName("resource_type") protected String resourceType; @@ -82,6 +83,18 @@ public String getName() { return name; } + /** + * Gets the remote. + * + * If present, this property indicates that the resource associated with this reference + * is remote and therefore may not be directly retrievable. + * + * @return the remote + */ + public BackupPolicyPlanRemote getRemote() { + return remote; + } + /** * Gets the resourceType. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemote.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemote.java new file mode 100644 index 0000000000..f42563a6fb --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemote.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * If present, this property indicates that the resource associated with this reference is remote and therefore may not + * be directly retrievable. + */ +public class BackupPolicyPlanRemote extends GenericModel { + + protected RegionReference region; + + protected BackupPolicyPlanRemote() { } + + /** + * Gets the region. + * + * If present, this property indicates that the referenced resource is remote to this + * region, and identifies the native region. + * + * @return the region + */ + public RegionReference getRegion() { + return region; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicy.java new file mode 100644 index 0000000000..f7cbf0afe6 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicy.java @@ -0,0 +1,64 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * BackupPolicyPlanRemoteRegionPolicy. + */ +public class BackupPolicyPlanRemoteRegionPolicy extends GenericModel { + + @SerializedName("delete_over_count") + protected Long deleteOverCount; + @SerializedName("encryption_key") + protected EncryptionKeyReference encryptionKey; + protected RegionReference region; + + protected BackupPolicyPlanRemoteRegionPolicy() { } + + /** + * Gets the deleteOverCount. + * + * The region this backup policy plan will create backups in. + * + * @return the deleteOverCount + */ + public Long getDeleteOverCount() { + return deleteOverCount; + } + + /** + * Gets the encryptionKey. + * + * The root key used to rewrap the data encryption key for the backup (snapshot). + * + * @return the encryptionKey + */ + public EncryptionKeyReference getEncryptionKey() { + return encryptionKey; + } + + /** + * Gets the region. + * + * The region this backup policy plan will create backups in. + * + * @return the region + */ + public RegionReference getRegion() { + return region; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyPrototype.java new file mode 100644 index 0000000000..9a19b0485c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyPrototype.java @@ -0,0 +1,161 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * BackupPolicyPlanRemoteRegionPolicyPrototype. + */ +public class BackupPolicyPlanRemoteRegionPolicyPrototype extends GenericModel { + + @SerializedName("delete_over_count") + protected Long deleteOverCount; + @SerializedName("encryption_key") + protected EncryptionKeyIdentity encryptionKey; + protected RegionIdentity region; + + /** + * Builder. + */ + public static class Builder { + private Long deleteOverCount; + private EncryptionKeyIdentity encryptionKey; + private RegionIdentity region; + + /** + * Instantiates a new Builder from an existing BackupPolicyPlanRemoteRegionPolicyPrototype instance. + * + * @param backupPolicyPlanRemoteRegionPolicyPrototype the instance to initialize the Builder with + */ + private Builder(BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototype) { + this.deleteOverCount = backupPolicyPlanRemoteRegionPolicyPrototype.deleteOverCount; + this.encryptionKey = backupPolicyPlanRemoteRegionPolicyPrototype.encryptionKey; + this.region = backupPolicyPlanRemoteRegionPolicyPrototype.region; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param region the region + */ + public Builder(RegionIdentity region) { + this.region = region; + } + + /** + * Builds a BackupPolicyPlanRemoteRegionPolicyPrototype. + * + * @return the new BackupPolicyPlanRemoteRegionPolicyPrototype instance + */ + public BackupPolicyPlanRemoteRegionPolicyPrototype build() { + return new BackupPolicyPlanRemoteRegionPolicyPrototype(this); + } + + /** + * Set the deleteOverCount. + * + * @param deleteOverCount the deleteOverCount + * @return the BackupPolicyPlanRemoteRegionPolicyPrototype builder + */ + public Builder deleteOverCount(long deleteOverCount) { + this.deleteOverCount = deleteOverCount; + return this; + } + + /** + * Set the encryptionKey. + * + * @param encryptionKey the encryptionKey + * @return the BackupPolicyPlanRemoteRegionPolicyPrototype builder + */ + public Builder encryptionKey(EncryptionKeyIdentity encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Set the region. + * + * @param region the region + * @return the BackupPolicyPlanRemoteRegionPolicyPrototype builder + */ + public Builder region(RegionIdentity region) { + this.region = region; + return this; + } + } + + protected BackupPolicyPlanRemoteRegionPolicyPrototype() { } + + protected BackupPolicyPlanRemoteRegionPolicyPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.region, + "region cannot be null"); + deleteOverCount = builder.deleteOverCount; + encryptionKey = builder.encryptionKey; + region = builder.region; + } + + /** + * New builder. + * + * @return a BackupPolicyPlanRemoteRegionPolicyPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the deleteOverCount. + * + * The region this backup policy plan will create backups in. + * + * @return the deleteOverCount + */ + public Long deleteOverCount() { + return deleteOverCount; + } + + /** + * Gets the encryptionKey. + * + * The root key to use to rewrap the data encryption key for the backup (snapshot). + * + * If unspecified, the source's `encryption_key` will be used. + * The specified key may be in a different account, subject to IAM policies. + * + * @return the encryptionKey + */ + public EncryptionKeyIdentity encryptionKey() { + return encryptionKey; + } + + /** + * Gets the region. + * + * The region this backup policy plan will create backups in. + * + * @return the region + */ + public RegionIdentity region() { + return region; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptions.java index f255cb212e..de6709123a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptions.java @@ -30,6 +30,7 @@ public class CreateBackupPolicyPlanOptions extends GenericModel { protected Boolean copyUserTags; protected BackupPolicyPlanDeletionTriggerPrototype deletionTrigger; protected String name; + protected List remoteRegionPolicies; /** * Builder. @@ -43,6 +44,7 @@ public static class Builder { private Boolean copyUserTags; private BackupPolicyPlanDeletionTriggerPrototype deletionTrigger; private String name; + private List remoteRegionPolicies; /** * Instantiates a new Builder from an existing CreateBackupPolicyPlanOptions instance. @@ -58,6 +60,7 @@ private Builder(CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions) { this.copyUserTags = createBackupPolicyPlanOptions.copyUserTags; this.deletionTrigger = createBackupPolicyPlanOptions.deletionTrigger; this.name = createBackupPolicyPlanOptions.name; + this.remoteRegionPolicies = createBackupPolicyPlanOptions.remoteRegionPolicies; } /** @@ -102,6 +105,22 @@ public Builder addAttachUserTags(String attachUserTags) { return this; } + /** + * Adds an remoteRegionPolicies to remoteRegionPolicies. + * + * @param remoteRegionPolicies the new remoteRegionPolicies + * @return the CreateBackupPolicyPlanOptions builder + */ + public Builder addRemoteRegionPolicies(BackupPolicyPlanRemoteRegionPolicyPrototype remoteRegionPolicies) { + com.ibm.cloud.sdk.core.util.Validator.notNull(remoteRegionPolicies, + "remoteRegionPolicies cannot be null"); + if (this.remoteRegionPolicies == null) { + this.remoteRegionPolicies = new ArrayList(); + } + this.remoteRegionPolicies.add(remoteRegionPolicies); + return this; + } + /** * Set the backupPolicyId. * @@ -190,6 +209,18 @@ public Builder name(String name) { this.name = name; return this; } + + /** + * Set the remoteRegionPolicies. + * Existing remoteRegionPolicies will be replaced. + * + * @param remoteRegionPolicies the remoteRegionPolicies + * @return the CreateBackupPolicyPlanOptions builder + */ + public Builder remoteRegionPolicies(List remoteRegionPolicies) { + this.remoteRegionPolicies = remoteRegionPolicies; + return this; + } } protected CreateBackupPolicyPlanOptions() { } @@ -207,6 +238,7 @@ protected CreateBackupPolicyPlanOptions(Builder builder) { copyUserTags = builder.copyUserTags; deletionTrigger = builder.deletionTrigger; name = builder.name; + remoteRegionPolicies = builder.remoteRegionPolicies; } /** @@ -306,5 +338,16 @@ public BackupPolicyPlanDeletionTriggerPrototype deletionTrigger() { public String name() { return name; } + + /** + * Gets the remoteRegionPolicies. + * + * The policies for additional backups in remote regions. + * + * @return the remoteRegionPolicies + */ + public List remoteRegionPolicies() { + return remoteRegionPolicies; + } } 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 6b65b73f32..65675f0f64 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 @@ -20,15 +20,9 @@ public class CreateIkePolicyOptions extends GenericModel { /** - * The authentication algorithm - * - * The `md5` and `sha1` algorithms have been deprecated. + * The authentication algorithm. */ public interface AuthenticationAlgorithm { - /** md5. */ - String MD5 = "md5"; - /** sha1. */ - String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; /** sha384. */ @@ -38,9 +32,7 @@ public interface AuthenticationAlgorithm { } /** - * The encryption algorithm - * - * The `triple_des` algorithm has been deprecated. + * The encryption algorithm. */ public interface EncryptionAlgorithm { /** aes128. */ @@ -49,8 +41,6 @@ public interface EncryptionAlgorithm { String AES192 = "aes192"; /** aes256. */ String AES256 = "aes256"; - /** triple_des. */ - String TRIPLE_DES = "triple_des"; } protected String authenticationAlgorithm; @@ -228,9 +218,7 @@ public Builder newBuilder() { /** * Gets the authenticationAlgorithm. * - * The authentication algorithm - * - * The `md5` and `sha1` algorithms have been deprecated. + * The authentication algorithm. * * @return the authenticationAlgorithm */ @@ -241,9 +229,7 @@ public String authenticationAlgorithm() { /** * Gets the dhGroup. * - * The Diffie-Hellman group - * - * Groups `2` and `5` have been deprecated. + * The Diffie-Hellman group. * * @return the dhGroup */ @@ -254,9 +240,7 @@ public Long dhGroup() { /** * Gets the encryptionAlgorithm. * - * The encryption algorithm - * - * The `triple_des` algorithm has been deprecated. + * The encryption algorithm. * * @return the encryptionAlgorithm */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptions.java index 9198699ef2..9e84257683 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupOptions.java @@ -246,7 +246,12 @@ public List subnets() { /** * Gets the applicationPort. * - * The port to use for new load balancer pool members created by this instance group. + * The port to use for new load balancer pool members created by this instance group. The load balancer pool member + * will receive load balancer traffic on this port, unless the load balancer listener is using a port range. (Traffic + * received on a listener using a port range will be sent to members using the same port the listener received it on.) + * + * This port will also be used for health checks unless the port property of + * `health_monitor` property is specified. * * This property must be specified if and only if `load_balancer_pool` has been specified. * @@ -260,9 +265,8 @@ public Long applicationPort() { * Gets the loadBalancer. * * The load balancer associated with the specified load balancer pool. - * Required if `load_balancer_pool` is specified. - * - * At present, only load balancers in the `application` family are supported. + * Required if `load_balancer_pool` is specified. The load balancer must have + * `instance_groups_supported` set to `true`. * * @return the loadBalancer */ @@ -273,8 +277,9 @@ public LoadBalancerIdentity loadBalancer() { /** * Gets the loadBalancerPool. * - * If specified, the load balancer pool this instance group will manage. A pool member - * will be created for each instance created by this group. + * If specified, this instance group will manage the load balancer pool. A pool member + * will be created for each instance created by this group. The specified load + * balancer pool must not be used by another instance group in the VPC. * * If specified, `load_balancer` and `application_port` must also be specified. * 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 c1e71e4e00..91daba4496 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 @@ -22,18 +22,12 @@ public class CreateIpsecPolicyOptions extends GenericModel { /** * The authentication algorithm * - * The `md5` and `sha1` algorithms have been deprecated - * * Must be `disabled` if and only if the `encryption_algorithm` is * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. */ public interface AuthenticationAlgorithm { /** disabled. */ String DISABLED = "disabled"; - /** md5. */ - String MD5 = "md5"; - /** sha1. */ - String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; /** sha384. */ @@ -45,8 +39,6 @@ public interface AuthenticationAlgorithm { /** * The encryption algorithm * - * The `triple_des` algorithm has been deprecated - * * The `authentication_algorithm` must be `disabled` if and only if * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or * `aes256gcm16`. @@ -64,14 +56,10 @@ public interface EncryptionAlgorithm { String AES256 = "aes256"; /** aes256gcm16. */ String AES256GCM16 = "aes256gcm16"; - /** triple_des. */ - String TRIPLE_DES = "triple_des"; } /** - * Perfect Forward Secrecy - * - * Groups `group_2` and `group_5` have been deprecated. + * Perfect Forward Secrecy. */ public interface Pfs { /** disabled. */ @@ -88,8 +76,6 @@ public interface Pfs { String GROUP_18 = "group_18"; /** group_19. */ String GROUP_19 = "group_19"; - /** group_2. */ - String GROUP_2 = "group_2"; /** group_20. */ String GROUP_20 = "group_20"; /** group_21. */ @@ -102,8 +88,6 @@ public interface Pfs { String GROUP_24 = "group_24"; /** group_31. */ String GROUP_31 = "group_31"; - /** group_5. */ - String GROUP_5 = "group_5"; } protected String authenticationAlgorithm; @@ -264,8 +248,6 @@ public Builder newBuilder() { * * The authentication algorithm * - * The `md5` and `sha1` algorithms have been deprecated - * * Must be `disabled` if and only if the `encryption_algorithm` is * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. * @@ -280,8 +262,6 @@ public String authenticationAlgorithm() { * * The encryption algorithm * - * The `triple_des` algorithm has been deprecated - * * The `authentication_algorithm` must be `disabled` if and only if * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or * `aes256gcm16`. @@ -295,9 +275,7 @@ public String encryptionAlgorithm() { /** * Gets the pfs. * - * Perfect Forward Secrecy - * - * Groups `group_2` and `group_5` have been deprecated. + * Perfect Forward Secrecy. * * @return the pfs */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateKeyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateKeyOptions.java index 97eb0e6fc3..acc28d755f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateKeyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateKeyOptions.java @@ -23,6 +23,8 @@ public class CreateKeyOptions extends GenericModel { * The crypto-system used by this key. */ public interface Type { + /** ed25519. */ + String ED25519 = "ed25519"; /** rsa. */ String RSA = "rsa"; } @@ -149,6 +151,9 @@ public Builder newBuilder() { * name, base64-encoded key, and a comment). The algorithm and comment fields may be omitted, as only the key field is * imported. * + * Keys of type `rsa` may be 2048 or 4096 bits in length, however 4096 is recommended. Keys of type `ed25519` are 256 + * bits in length. + * * @return the publicKey */ public String publicKey() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteResponse.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteResponse.java new file mode 100644 index 0000000000..d179bcb887 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteResponse.java @@ -0,0 +1,247 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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 com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * CreateVpcRouteResponse. + */ +public class CreateVpcRouteResponse extends GenericModel { + + /** + * The action to perform with a packet matching the route: + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + * - `deliver`: deliver the packet to the specified `next_hop` + * - `drop`: drop the packet. + */ + public interface Action { + /** delegate. */ + String DELEGATE = "delegate"; + /** delegate_vpc. */ + String DELEGATE_VPC = "delegate_vpc"; + /** deliver. */ + String DELIVER = "deliver"; + /** drop. */ + String DROP = "drop"; + } + + /** + * The lifecycle state of the route. + */ + 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 origin of this route: + * - `service`: route was directly created by a service + * - `user`: route was directly created by a user + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + * unexpected property value was encountered. + */ + public interface Origin { + /** service. */ + String SERVICE = "service"; + /** user. */ + String USER = "user"; + } + + protected String action; + @SerializedName("created_at") + protected Date createdAt; + protected RouteCreator creator; + protected String destination; + protected String href; + protected String id; + @SerializedName("lifecycle_state") + protected String lifecycleState; + protected String name; + @SerializedName("next_hop") + protected RouteNextHop nextHop; + protected String origin; + protected Long priority; + protected ZoneReference zone; + + protected CreateVpcRouteResponse() { } + + /** + * Gets the action. + * + * The action to perform with a packet matching the route: + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + * - `deliver`: deliver the packet to the specified `next_hop` + * - `drop`: drop the packet. + * + * @return the action + */ + public String getAction() { + return action; + } + + /** + * Gets the createdAt. + * + * The date and time that the route was created. + * + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * Gets the creator. + * + * If present, the resource that created the route. Routes with this property present cannot + * be directly deleted. All routes with an `origin` of `service` will have this property set, + * and future `origin` values may also have this property set. + * + * @return the creator + */ + public RouteCreator getCreator() { + return creator; + } + + /** + * Gets the destination. + * + * The destination of the route. + * + * @return the destination + */ + public String getDestination() { + return destination; + } + + /** + * Gets the href. + * + * The URL for this route. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the id. + * + * The unique identifier for this route. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the lifecycleState. + * + * The lifecycle state of the route. + * + * @return the lifecycleState + */ + public String getLifecycleState() { + return lifecycleState; + } + + /** + * Gets the name. + * + * The name for this route. The name is unique across all routes in the routing table. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the nextHop. + * + * If `action` is `deliver`, the next hop that packets will be delivered to. For + * other `action` values, its `address` will be `0.0.0.0`. + * + * @return the nextHop + */ + public RouteNextHop getNextHop() { + return nextHop; + } + + /** + * Gets the origin. + * + * The origin of this route: + * - `service`: route was directly created by a service + * - `user`: route was directly created by a user + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + * unexpected property value was encountered. + * + * @return the origin + */ + public String getOrigin() { + return origin; + } + + /** + * Gets the priority. + * + * The priority of this route. Smaller values have higher priority. + * + * If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + * priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + * distributed between them. + * + * @return the priority + */ + public Long getPriority() { + return priority; + } + + /** + * Gets the zone. + * + * The zone the route applies to. (Traffic from subnets in this zone will be + * subject to this route.). + * + * @return the zone + */ + public ZoneReference getZone() { + return zone; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotsOptions.java index ee869582cf..0aff4cf79a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteSnapshotsOptions.java @@ -92,7 +92,7 @@ public Builder newBuilder() { /** * Gets the sourceVolumeId. * - * Filters the collection to resources with the source volume with the specified identifier. + * Filters the collection to resources with a `source_volume.id` property matching the specified identifier. * * @return the sourceVolumeId */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteResponse.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteResponse.java new file mode 100644 index 0000000000..7da939633c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteResponse.java @@ -0,0 +1,247 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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 com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * GetVpcRouteResponse. + */ +public class GetVpcRouteResponse extends GenericModel { + + /** + * The action to perform with a packet matching the route: + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + * - `deliver`: deliver the packet to the specified `next_hop` + * - `drop`: drop the packet. + */ + public interface Action { + /** delegate. */ + String DELEGATE = "delegate"; + /** delegate_vpc. */ + String DELEGATE_VPC = "delegate_vpc"; + /** deliver. */ + String DELIVER = "deliver"; + /** drop. */ + String DROP = "drop"; + } + + /** + * The lifecycle state of the route. + */ + 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 origin of this route: + * - `service`: route was directly created by a service + * - `user`: route was directly created by a user + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + * unexpected property value was encountered. + */ + public interface Origin { + /** service. */ + String SERVICE = "service"; + /** user. */ + String USER = "user"; + } + + protected String action; + @SerializedName("created_at") + protected Date createdAt; + protected RouteCreator creator; + protected String destination; + protected String href; + protected String id; + @SerializedName("lifecycle_state") + protected String lifecycleState; + protected String name; + @SerializedName("next_hop") + protected RouteNextHop nextHop; + protected String origin; + protected Long priority; + protected ZoneReference zone; + + protected GetVpcRouteResponse() { } + + /** + * Gets the action. + * + * The action to perform with a packet matching the route: + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + * - `deliver`: deliver the packet to the specified `next_hop` + * - `drop`: drop the packet. + * + * @return the action + */ + public String getAction() { + return action; + } + + /** + * Gets the createdAt. + * + * The date and time that the route was created. + * + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * Gets the creator. + * + * If present, the resource that created the route. Routes with this property present cannot + * be directly deleted. All routes with an `origin` of `service` will have this property set, + * and future `origin` values may also have this property set. + * + * @return the creator + */ + public RouteCreator getCreator() { + return creator; + } + + /** + * Gets the destination. + * + * The destination of the route. + * + * @return the destination + */ + public String getDestination() { + return destination; + } + + /** + * Gets the href. + * + * The URL for this route. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the id. + * + * The unique identifier for this route. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the lifecycleState. + * + * The lifecycle state of the route. + * + * @return the lifecycleState + */ + public String getLifecycleState() { + return lifecycleState; + } + + /** + * Gets the name. + * + * The name for this route. The name is unique across all routes in the routing table. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the nextHop. + * + * If `action` is `deliver`, the next hop that packets will be delivered to. For + * other `action` values, its `address` will be `0.0.0.0`. + * + * @return the nextHop + */ + public RouteNextHop getNextHop() { + return nextHop; + } + + /** + * Gets the origin. + * + * The origin of this route: + * - `service`: route was directly created by a service + * - `user`: route was directly created by a user + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + * unexpected property value was encountered. + * + * @return the origin + */ + public String getOrigin() { + return origin; + } + + /** + * Gets the priority. + * + * The priority of this route. Smaller values have higher priority. + * + * If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + * priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + * distributed between them. + * + * @return the priority + */ + public Long getPriority() { + return priority; + } + + /** + * Gets the zone. + * + * The zone the route applies to. (Traffic from subnets in this zone will be + * subject to this route.). + * + * @return the zone + */ + public ZoneReference getZone() { + return zone; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatch.java index 8849d5a586..aedb02f6b1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatch.java @@ -24,15 +24,9 @@ public class IKEPolicyPatch extends GenericModel { /** - * The authentication algorithm - * - * The `md5` and `sha1` algorithms have been deprecated. + * The authentication algorithm. */ public interface AuthenticationAlgorithm { - /** md5. */ - String MD5 = "md5"; - /** sha1. */ - String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; /** sha384. */ @@ -42,9 +36,7 @@ public interface AuthenticationAlgorithm { } /** - * The encryption algorithm - * - * The `triple_des` algorithm has been deprecated. + * The encryption algorithm. */ public interface EncryptionAlgorithm { /** aes128. */ @@ -53,8 +45,6 @@ public interface EncryptionAlgorithm { String AES192 = "aes192"; /** aes256. */ String AES256 = "aes256"; - /** triple_des. */ - String TRIPLE_DES = "triple_des"; } @SerializedName("authentication_algorithm") @@ -199,9 +189,7 @@ public Builder newBuilder() { /** * Gets the authenticationAlgorithm. * - * The authentication algorithm - * - * The `md5` and `sha1` algorithms have been deprecated. + * The authentication algorithm. * * @return the authenticationAlgorithm */ @@ -212,9 +200,7 @@ public String authenticationAlgorithm() { /** * Gets the dhGroup. * - * The Diffie-Hellman group - * - * Groups `2` and `5` have been deprecated. + * The Diffie-Hellman group. * * @return the dhGroup */ @@ -225,9 +211,7 @@ public Long dhGroup() { /** * Gets the encryptionAlgorithm. * - * The encryption algorithm - * - * The `triple_des` algorithm has been deprecated. + * The encryption algorithm. * * @return the encryptionAlgorithm */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatch.java index de143bf32f..6a0f499e31 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/IPsecPolicyPatch.java @@ -26,18 +26,12 @@ public class IPsecPolicyPatch extends GenericModel { /** * The authentication algorithm * - * The `md5` and `sha1` algorithms have been deprecated - * * Must be `disabled` if and only if the `encryption_algorithm` is * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. */ public interface AuthenticationAlgorithm { /** disabled. */ String DISABLED = "disabled"; - /** md5. */ - String MD5 = "md5"; - /** sha1. */ - String SHA1 = "sha1"; /** sha256. */ String SHA256 = "sha256"; /** sha384. */ @@ -49,8 +43,6 @@ public interface AuthenticationAlgorithm { /** * The encryption algorithm * - * The `triple_des` algorithm has been deprecated - * * The `authentication_algorithm` must be `disabled` if and only if * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or * `aes256gcm16`. @@ -68,14 +60,10 @@ public interface EncryptionAlgorithm { String AES256 = "aes256"; /** aes256gcm16. */ String AES256GCM16 = "aes256gcm16"; - /** triple_des. */ - String TRIPLE_DES = "triple_des"; } /** - * Perfect Forward Secrecy - * - * Groups `group_2` and `group_5` have been deprecated. + * Perfect Forward Secrecy. */ public interface Pfs { /** disabled. */ @@ -92,8 +80,6 @@ public interface Pfs { String GROUP_18 = "group_18"; /** group_19. */ String GROUP_19 = "group_19"; - /** group_2. */ - String GROUP_2 = "group_2"; /** group_20. */ String GROUP_20 = "group_20"; /** group_21. */ @@ -106,8 +92,6 @@ public interface Pfs { String GROUP_24 = "group_24"; /** group_31. */ String GROUP_31 = "group_31"; - /** group_5. */ - String GROUP_5 = "group_5"; } @SerializedName("authentication_algorithm") @@ -237,8 +221,6 @@ public Builder newBuilder() { * * The authentication algorithm * - * The `md5` and `sha1` algorithms have been deprecated - * * Must be `disabled` if and only if the `encryption_algorithm` is * `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. * @@ -253,8 +235,6 @@ public String authenticationAlgorithm() { * * The encryption algorithm * - * The `triple_des` algorithm has been deprecated - * * The `authentication_algorithm` must be `disabled` if and only if * `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or * `aes256gcm16`. @@ -290,9 +270,7 @@ public String name() { /** * Gets the pfs. * - * Perfect Forward Secrecy - * - * Groups `group_2` and `group_5` have been deprecated. + * Perfect Forward Secrecy. * * @return the pfs */ 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 0ae02d046a..070e4b2f36 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 @@ -33,13 +33,22 @@ public interface Encryption { String USER_MANAGED = "user_managed"; } + /** + * The resource type. + */ + public interface ResourceType { + /** image. */ + String IMAGE = "image"; + } + /** * The status of this image * - available: image can be used (provisionable) * - deleting: image is being deleted, and can no longer be used to provision new * resources - * - deprecated: image is administratively slated to be deleted + * - deprecated: image is administratively slated to become `obsolete` * - failed: image is corrupt or did not pass validation + * - obsolete: image administratively set to not be used for new resources * - pending: image is being imported and is not yet `available` * - unusable: image cannot be used (see `status_reasons[]` for possible remediation) * @@ -56,6 +65,8 @@ public interface Status { String DEPRECATED = "deprecated"; /** failed. */ String FAILED = "failed"; + /** obsolete. */ + String OBSOLETE = "obsolete"; /** pending. */ String PENDING = "pending"; /** unusable. */ @@ -63,7 +74,9 @@ public interface Status { } /** - * Whether the image is publicly visible or private to the account. + * The visibility of this image. + * - `private`: Visible only to this account + * - `public`: Visible to all accounts. */ public interface Visibility { /** private. */ @@ -77,6 +90,8 @@ public interface Visibility { @SerializedName("created_at") protected Date createdAt; protected String crn; + @SerializedName("deprecation_at") + protected Date deprecationAt; protected String encryption; @SerializedName("encryption_key") protected EncryptionKeyReference encryptionKey; @@ -86,10 +101,14 @@ public interface Visibility { @SerializedName("minimum_provisioned_size") protected Long minimumProvisionedSize; protected String name; + @SerializedName("obsolescence_at") + protected Date obsolescenceAt; @SerializedName("operating_system") protected OperatingSystem operatingSystem; @SerializedName("resource_group") protected ResourceGroupReference resourceGroup; + @SerializedName("resource_type") + protected String resourceType; @SerializedName("source_volume") protected VolumeReference sourceVolume; protected String status; @@ -130,6 +149,19 @@ public String getCrn() { return crn; } + /** + * Gets the deprecationAt. + * + * The deprecation date and time (UTC) for this image. + * + * If absent, no deprecation date and time has been set. + * + * @return the deprecationAt + */ + public Date getDeprecationAt() { + return deprecationAt; + } + /** * Gets the encryption. * @@ -212,6 +244,19 @@ public String getName() { return name; } + /** + * Gets the obsolescenceAt. + * + * The obsolescence date and time (UTC) for this image. + * + * If absent, no obsolescence date and time has been set. + * + * @return the obsolescenceAt + */ + public Date getObsolescenceAt() { + return obsolescenceAt; + } + /** * Gets the operatingSystem. * @@ -234,6 +279,17 @@ public ResourceGroupReference getResourceGroup() { return resourceGroup; } + /** + * Gets the resourceType. + * + * The resource type. + * + * @return the resourceType + */ + public String getResourceType() { + return resourceType; + } + /** * Gets the sourceVolume. * @@ -254,8 +310,9 @@ public VolumeReference getSourceVolume() { * - available: image can be used (provisionable) * - deleting: image is being deleted, and can no longer be used to provision new * resources - * - deprecated: image is administratively slated to be deleted + * - deprecated: image is administratively slated to become `obsolete` * - failed: image is corrupt or did not pass validation + * - obsolete: image administratively set to not be used for new resources * - pending: image is being imported and is not yet `available` * - unusable: image cannot be used (see `status_reasons[]` for possible remediation) * @@ -298,7 +355,9 @@ public List getStatusReasons() { /** * Gets the visibility. * - * Whether the image is publicly visible or private to the account. + * The visibility of this image. + * - `private`: Visible only to this account + * - `public`: Visible to all accounts. * * @return the visibility */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollection.java index bb91a31ae9..9f85865745 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageCollection.java @@ -14,6 +14,7 @@ import java.util.List; +import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; /** @@ -25,6 +26,8 @@ public class ImageCollection extends GenericModel { protected List images; protected Long limit; protected ImageCollectionNext next; + @SerializedName("total_count") + protected Long totalCount; protected ImageCollection() { } @@ -72,5 +75,16 @@ public Long getLimit() { public ImageCollectionNext 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/ImagePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java index a78df4bc2a..acb6a24b0a 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 @@ -12,8 +12,10 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.Date; 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; @@ -22,13 +24,19 @@ */ public class ImagePatch extends GenericModel { + @SerializedName("deprecation_at") + protected Date deprecationAt; protected String name; + @SerializedName("obsolescence_at") + protected Date obsolescenceAt; /** * Builder. */ public static class Builder { + private Date deprecationAt; private String name; + private Date obsolescenceAt; /** * Instantiates a new Builder from an existing ImagePatch instance. @@ -36,7 +44,9 @@ public static class Builder { * @param imagePatch the instance to initialize the Builder with */ private Builder(ImagePatch imagePatch) { + this.deprecationAt = imagePatch.deprecationAt; this.name = imagePatch.name; + this.obsolescenceAt = imagePatch.obsolescenceAt; } /** @@ -54,6 +64,17 @@ public ImagePatch build() { return new ImagePatch(this); } + /** + * Set the deprecationAt. + * + * @param deprecationAt the deprecationAt + * @return the ImagePatch builder + */ + public Builder deprecationAt(Date deprecationAt) { + this.deprecationAt = deprecationAt; + return this; + } + /** * Set the name. * @@ -64,12 +85,25 @@ public Builder name(String name) { this.name = name; return this; } + + /** + * Set the obsolescenceAt. + * + * @param obsolescenceAt the obsolescenceAt + * @return the ImagePatch builder + */ + public Builder obsolescenceAt(Date obsolescenceAt) { + this.obsolescenceAt = obsolescenceAt; + return this; + } } protected ImagePatch() { } protected ImagePatch(Builder builder) { + deprecationAt = builder.deprecationAt; name = builder.name; + obsolescenceAt = builder.obsolescenceAt; } /** @@ -81,6 +115,31 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the deprecationAt. + * + * The deprecation date and time to set for this image. + * + * This cannot be set if the image has a `status` of `failed` or `deleting`, or if + * `catalog_offering.managed` is `true`. + * + * The date and time must not be in the past, and must be earlier than `obsolescence_at` + * (if `obsolescence_at` is set). Additionally, if the image status is currently + * `deprecated`, the value cannot be changed (but may be removed). + * + * Specify `null` to remove an existing deprecation date and time. If the image status is currently `deprecated`, it + * will become `available`. + * + * If the deprecation date and time is reached while the image has a status of `pending`, the image's status will + * transition to `deprecated` upon its successful creation (or + * `obsolete` if the obsolescence date and time was also reached). + * + * @return the deprecationAt + */ + public Date deprecationAt() { + return deprecationAt; + } + /** * Gets the name. * @@ -93,6 +152,30 @@ public String name() { return name; } + /** + * Gets the obsolescenceAt. + * + * The obsolescence date and time to set for this image. + * + * This cannot be set if the image has a `status` of `failed` or `deleting`, or if + * `catalog_offering.managed` is `true`. + * + * The date and time must not be in the past, and must be later than `deprecation_at` (if + * `deprecation_at` is set). Additionally, if the image status is currently `obsolete`, the value cannot be changed + * (but may be removed). + * + * Specify `null` to remove an existing obsolescence date and time. If the image status is currently `obsolete`, it + * will become `deprecated` if `deprecation_at` is in the past. Otherwise, it will become `available`. + * + * If the obsolescence date and time is reached while the image has a status of `pending`, the image's status will + * transition to `obsolete` upon its successful creation. + * + * @return the obsolescenceAt + */ + public Date obsolescenceAt() { + return obsolescenceAt; + } + /** * Construct a JSON merge-patch from the ImagePatch. * 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 2c196e05e6..90260f0551 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 @@ -12,6 +12,8 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.Date; + import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -24,7 +26,11 @@ */ public class ImagePrototype extends GenericModel { + @SerializedName("deprecation_at") + protected Date deprecationAt; protected String name; + @SerializedName("obsolescence_at") + protected Date obsolescenceAt; @SerializedName("resource_group") protected ResourceGroupIdentity resourceGroup; @SerializedName("encrypted_data_key") @@ -39,6 +45,26 @@ public class ImagePrototype extends GenericModel { protected ImagePrototype() { } + /** + * Gets the deprecationAt. + * + * The deprecation date and time to set for this image. + * + * The date and time must not be in the past, and must be earlier than `obsolescence_at` + * (if `obsolescence_at` is set). + * + * If unspecified, no deprecation date and time will be set. + * + * If the deprecation date and time is reached while the image has a status of `pending`, the image's status will + * transition to `deprecated` upon its successful creation (or + * `obsolete` if the obsolescence date and time was also reached). + * + * @return the deprecationAt + */ + public Date deprecationAt() { + return deprecationAt; + } + /** * Gets the name. * @@ -52,6 +78,25 @@ public String name() { return name; } + /** + * Gets the obsolescenceAt. + * + * The obsolescence date and time to set for this image. + * + * The date and time must not be in the past, and must be later than `deprecation_at` (if + * `deprecation_at` is set). + * + * If unspecified, no obsolescence date and time will be set. + * + * If the obsolescence date and time is reached while the image has a status of + * `pending`, the image's status will transition to `obsolete` upon its successful creation. + * + * @return the obsolescenceAt + */ + public Date obsolescenceAt() { + return obsolescenceAt; + } + /** * Gets the resourceGroup. * 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 d57fc53342..892678924f 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 @@ -12,6 +12,8 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.Date; + /** * ImagePrototypeImageByFile. */ @@ -22,7 +24,9 @@ public class ImagePrototypeImageByFile extends ImagePrototype { * Builder. */ public static class Builder { + private Date deprecationAt; private String name; + private Date obsolescenceAt; private ResourceGroupIdentity resourceGroup; private String encryptedDataKey; private EncryptionKeyIdentity encryptionKey; @@ -35,7 +39,9 @@ public static class Builder { * @param imagePrototypeImageByFile the instance to initialize the Builder with */ public Builder(ImagePrototype imagePrototypeImageByFile) { + this.deprecationAt = imagePrototypeImageByFile.deprecationAt; this.name = imagePrototypeImageByFile.name; + this.obsolescenceAt = imagePrototypeImageByFile.obsolescenceAt; this.resourceGroup = imagePrototypeImageByFile.resourceGroup; this.encryptedDataKey = imagePrototypeImageByFile.encryptedDataKey; this.encryptionKey = imagePrototypeImageByFile.encryptionKey; @@ -69,6 +75,17 @@ public ImagePrototypeImageByFile build() { return new ImagePrototypeImageByFile(this); } + /** + * Set the deprecationAt. + * + * @param deprecationAt the deprecationAt + * @return the ImagePrototypeImageByFile builder + */ + public Builder deprecationAt(Date deprecationAt) { + this.deprecationAt = deprecationAt; + return this; + } + /** * Set the name. * @@ -80,6 +97,17 @@ public Builder name(String name) { return this; } + /** + * Set the obsolescenceAt. + * + * @param obsolescenceAt the obsolescenceAt + * @return the ImagePrototypeImageByFile builder + */ + public Builder obsolescenceAt(Date obsolescenceAt) { + this.obsolescenceAt = obsolescenceAt; + return this; + } + /** * Set the resourceGroup. * @@ -143,7 +171,9 @@ protected ImagePrototypeImageByFile(Builder builder) { "file cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operatingSystem, "operatingSystem cannot be null"); + deprecationAt = builder.deprecationAt; name = builder.name; + obsolescenceAt = builder.obsolescenceAt; resourceGroup = builder.resourceGroup; encryptedDataKey = builder.encryptedDataKey; encryptionKey = builder.encryptionKey; 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 94ce27d3d2..e673a6e02f 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 @@ -12,6 +12,8 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.Date; + /** * ImagePrototypeImageBySourceVolume. */ @@ -22,7 +24,9 @@ public class ImagePrototypeImageBySourceVolume extends ImagePrototype { * Builder. */ public static class Builder { + private Date deprecationAt; private String name; + private Date obsolescenceAt; private ResourceGroupIdentity resourceGroup; private EncryptionKeyIdentity encryptionKey; private VolumeIdentity sourceVolume; @@ -33,7 +37,9 @@ public static class Builder { * @param imagePrototypeImageBySourceVolume the instance to initialize the Builder with */ public Builder(ImagePrototype imagePrototypeImageBySourceVolume) { + this.deprecationAt = imagePrototypeImageBySourceVolume.deprecationAt; this.name = imagePrototypeImageBySourceVolume.name; + this.obsolescenceAt = imagePrototypeImageBySourceVolume.obsolescenceAt; this.resourceGroup = imagePrototypeImageBySourceVolume.resourceGroup; this.encryptionKey = imagePrototypeImageBySourceVolume.encryptionKey; this.sourceVolume = imagePrototypeImageBySourceVolume.sourceVolume; @@ -63,6 +69,17 @@ public ImagePrototypeImageBySourceVolume build() { return new ImagePrototypeImageBySourceVolume(this); } + /** + * Set the deprecationAt. + * + * @param deprecationAt the deprecationAt + * @return the ImagePrototypeImageBySourceVolume builder + */ + public Builder deprecationAt(Date deprecationAt) { + this.deprecationAt = deprecationAt; + return this; + } + /** * Set the name. * @@ -74,6 +91,17 @@ public Builder name(String name) { return this; } + /** + * Set the obsolescenceAt. + * + * @param obsolescenceAt the obsolescenceAt + * @return the ImagePrototypeImageBySourceVolume builder + */ + public Builder obsolescenceAt(Date obsolescenceAt) { + this.obsolescenceAt = obsolescenceAt; + return this; + } + /** * Set the resourceGroup. * @@ -113,7 +141,9 @@ protected ImagePrototypeImageBySourceVolume() { } protected ImagePrototypeImageBySourceVolume(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceVolume, "sourceVolume cannot be null"); + deprecationAt = builder.deprecationAt; name = builder.name; + obsolescenceAt = builder.obsolescenceAt; resourceGroup = builder.resourceGroup; encryptionKey = builder.encryptionKey; sourceVolume = builder.sourceVolume; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReference.java index 4549886dc3..c62bc27d19 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageReference.java @@ -12,6 +12,7 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; /** @@ -19,11 +20,22 @@ */ public class ImageReference extends GenericModel { + /** + * The resource type. + */ + public interface ResourceType { + /** image. */ + String IMAGE = "image"; + } + protected String crn; protected ImageReferenceDeleted deleted; protected String href; protected String id; protected String name; + protected ImageRemote remote; + @SerializedName("resource_type") + protected String resourceType; protected ImageReference() { } @@ -82,5 +94,28 @@ public String getId() { public String getName() { return name; } + + /** + * Gets the remote. + * + * If present, this property indicates that the resource associated with this reference + * is remote and therefore may not be directly retrievable. + * + * @return the remote + */ + public ImageRemote getRemote() { + return remote; + } + + /** + * 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/ImageRemote.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageRemote.java new file mode 100644 index 0000000000..7114437e07 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageRemote.java @@ -0,0 +1,52 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * If present, this property indicates that the resource associated with this reference is remote and therefore may not + * be directly retrievable. + */ +public class ImageRemote extends GenericModel { + + protected AccountReference account; + protected RegionReference region; + + protected ImageRemote() { } + + /** + * Gets the account. + * + * If present, this property indicates that the referenced resource is remote to this + * account, and identifies the owning account. + * + * @return the account + */ + public AccountReference getAccount() { + return account; + } + + /** + * Gets the region. + * + * If present, this property indicates that the referenced resource is remote to this + * region, and identifies the native region. + * + * @return the region + */ + public RegionReference getRegion() { + return region; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatch.java index 8c89ffafd6..1e17a1559d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupPatch.java @@ -226,10 +226,10 @@ public InstanceTemplateIdentity instanceTemplate() { /** * Gets the loadBalancer. * - * The load balancer associated with the specified load balancer pool. - * Required if `load_balancer_pool` is specified. + * The load balancer associated with `load_balancer_pool`. + * The load balancer must have `instance_groups_supported` set to `true`. * - * At present, only load balancers in the `application` family are supported. + * This property must be set if and only if `load_balancer_pool` has been set. * * @return the loadBalancer */ @@ -240,8 +240,9 @@ public LoadBalancerIdentity loadBalancer() { /** * Gets the loadBalancerPool. * - * If set, the load balancer pool this instance group will manage. A pool member will - * be created for each instance created by this group. + * If specified, this instance group will manage the load balancer pool. A pool member + * will be created for each instance created by this group. The specified load + * balancer pool must not be used by another instance group in the VPC. * * If set, `load_balancer` and `application_port` must also be set. * 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 12470c76a3..d919db25b6 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 @@ -98,7 +98,7 @@ public InstanceDefaultTrustedProfilePrototype defaultTrustedProfile() { * virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as * SSH authorized keys for the administrative user. * - * For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator + * For Windows images, the keys of type `rsa` must be specified, and one will be chosen to encrypt [the administrator * password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but * if no keys are specified, the instance will be inaccessible unless the specified image provides another means of * access. 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 882682f69e..ac80f5bca7 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 @@ -16,7 +16,7 @@ import java.util.List; /** - * InstancePrototypeInstanceByCatalogOffering. + * Create an instance by using a catalog offering. */ public class InstancePrototypeInstanceByCatalogOffering extends InstancePrototype { 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 b0cd03eef7..69fd48411a 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 @@ -16,7 +16,7 @@ import java.util.List; /** - * InstancePrototypeInstanceByImage. + * Create an instance by using an image. */ public class InstancePrototypeInstanceByImage extends InstancePrototype { 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 0587da357f..bffa9c91a9 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 @@ -16,7 +16,7 @@ import java.util.List; /** - * InstancePrototypeInstanceBySourceSnapshot. + * Create an instance by using a snapshot. */ public class InstancePrototypeInstanceBySourceSnapshot extends InstancePrototype { 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 10e53bb44c..96b27a9226 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 @@ -16,7 +16,10 @@ import java.util.List; /** - * InstancePrototypeInstanceBySourceTemplate. + * Create an instance by using an instance template. + * + * The `primary_network_interface` and `network_interfaces` properties may only be specified if + * `primary_network_interface` is specified in the source template. */ public class InstancePrototypeInstanceBySourceTemplate extends InstancePrototype { 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 90487b974c..494b8fc746 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 @@ -16,7 +16,7 @@ import java.util.List; /** - * InstancePrototypeInstanceByVolume. + * Create an instance by using a boot volume. */ public class InstancePrototypeInstanceByVolume extends InstancePrototype { 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 1a0ee8d7d5..63f2acc28a 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 @@ -22,9 +22,9 @@ * InstanceTemplate. * * Classes which extend this class: - * - InstanceTemplateInstanceByImageInstanceTemplateContext - * - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext - * - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext + * - InstanceTemplateInstanceByImage + * - InstanceTemplateInstanceBySourceSnapshot + * - InstanceTemplateInstanceByCatalogOffering */ public class InstanceTemplate extends GenericModel { @@ -144,7 +144,7 @@ public String getId() { * virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as * SSH authorized keys for the administrative user. * - * For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator + * For Windows images, the keys of type `rsa` must be specified, and one will be chosen to encrypt [the administrator * password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but * if no keys are specified, the instance will be inaccessible unless the specified image provides another means of * access. 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/InstanceTemplateInstanceByCatalogOffering.java similarity index 74% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContext.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOffering.java index fbe321c0c0..79af38768f 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/InstanceTemplateInstanceByCatalogOffering.java @@ -13,11 +13,11 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * InstanceTemplateInstanceByImageInstanceTemplateContext. + * Create an instance by using a catalog offering. */ -public class InstanceTemplateInstanceByImageInstanceTemplateContext extends InstanceTemplate { +public class InstanceTemplateInstanceByCatalogOffering extends InstanceTemplate { - protected InstanceTemplateInstanceByImageInstanceTemplateContext() { } + protected InstanceTemplateInstanceByCatalogOffering() { } } 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/InstanceTemplateInstanceByImage.java similarity index 71% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImage.java index d22e1256a2..5cbceefa6e 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/InstanceTemplateInstanceByImage.java @@ -13,11 +13,11 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext. + * Create an instance by using an image. */ -public class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext extends InstanceTemplate { +public class InstanceTemplateInstanceByImage extends InstanceTemplate { - protected InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() { } + protected InstanceTemplateInstanceByImage() { } } 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/InstanceTemplateInstanceBySourceSnapshot.java similarity index 71% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshot.java index 9ec542c8d5..3bae4d67e0 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/InstanceTemplateInstanceBySourceSnapshot.java @@ -13,11 +13,11 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext. + * Create an instance by using a snapshot. */ -public class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext extends InstanceTemplate { +public class InstanceTemplateInstanceBySourceSnapshot extends InstanceTemplate { - protected InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() { } + protected InstanceTemplateInstanceBySourceSnapshot() { } } 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 fcdb3323f6..8c3df95e12 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 @@ -21,10 +21,10 @@ * InstanceTemplatePrototype. * * Classes which extend this class: - * - InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext - * - InstanceTemplatePrototypeInstanceBySourceTemplate - * - InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext - * - InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext + * - InstanceTemplatePrototypeInstanceTemplateByImage + * - InstanceTemplatePrototypeInstanceTemplateBySourceTemplate + * - InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot + * - InstanceTemplatePrototypeInstanceTemplateByCatalogOffering */ public class InstanceTemplatePrototype extends GenericModel { @@ -97,7 +97,7 @@ public InstanceDefaultTrustedProfilePrototype defaultTrustedProfile() { * virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as * SSH authorized keys for the administrative user. * - * For Windows images, at least one key must be specified, and one will be chosen to encrypt [the administrator + * For Windows images, the keys of type `rsa` must be specified, and one will be chosen to encrypt [the administrator * password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but * if no keys are specified, the instance will be inaccessible unless the specified image provides another means of * access. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.java similarity index 66% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.java index 191171e861..8dc90f84b4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.java @@ -16,9 +16,9 @@ import java.util.List; /** - * InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext. + * Create an instance template that creates instances by using a catalog offering. */ -public class InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext extends InstanceTemplatePrototype { +public class InstanceTemplatePrototypeInstanceTemplateByCatalogOffering extends InstanceTemplatePrototype { /** @@ -44,28 +44,28 @@ public static class Builder { private ZoneIdentity zone; /** - * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext instance. + * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceTemplateByCatalogOffering instance. * - * @param instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext the instance to initialize the Builder with + * @param instanceTemplatePrototypeInstanceTemplateByCatalogOffering the instance to initialize the Builder with */ - public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext) { - this.availabilityPolicy = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.availabilityPolicy; - this.defaultTrustedProfile = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.defaultTrustedProfile; - this.keys = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.keys; - this.metadataService = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.metadataService; - this.name = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.name; - this.placementTarget = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.placementTarget; - this.profile = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.profile; - this.resourceGroup = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.resourceGroup; - this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.totalVolumeBandwidth; - this.userData = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.userData; - this.volumeAttachments = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.volumeAttachments; - this.vpc = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.vpc; - this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.bootVolumeAttachment; - this.catalogOffering = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.catalogOffering; - this.networkInterfaces = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.networkInterfaces; - this.primaryNetworkInterface = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.primaryNetworkInterface; - this.zone = instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.zone; + public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceTemplateByCatalogOffering) { + this.availabilityPolicy = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.availabilityPolicy; + this.defaultTrustedProfile = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.defaultTrustedProfile; + this.keys = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.keys; + this.metadataService = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.metadataService; + this.name = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.name; + this.placementTarget = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.placementTarget; + this.profile = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.profile; + this.resourceGroup = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.resourceGroup; + this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.totalVolumeBandwidth; + this.userData = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.userData; + this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.volumeAttachments; + this.vpc = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.vpc; + this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceTemplateByCatalogOffering.bootVolumeAttachment; + this.catalogOffering = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.catalogOffering; + this.networkInterfaces = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.networkInterfaces; + this.primaryNetworkInterface = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.primaryNetworkInterface; + this.zone = instanceTemplatePrototypeInstanceTemplateByCatalogOffering.zone; } /** @@ -78,27 +78,29 @@ public Builder() { * Instantiates a new builder with required properties. * * @param catalogOffering the catalogOffering + * @param primaryNetworkInterface the primaryNetworkInterface * @param zone the zone */ - public Builder(InstanceCatalogOfferingPrototype catalogOffering, ZoneIdentity zone) { + public Builder(InstanceCatalogOfferingPrototype catalogOffering, NetworkInterfacePrototype primaryNetworkInterface, ZoneIdentity zone) { this.catalogOffering = catalogOffering; + this.primaryNetworkInterface = primaryNetworkInterface; this.zone = zone; } /** - * Builds a InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext. + * Builds a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering. * - * @return the new InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext instance + * @return the new InstanceTemplatePrototypeInstanceTemplateByCatalogOffering instance */ - public InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext build() { - return new InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext(this); + public InstanceTemplatePrototypeInstanceTemplateByCatalogOffering build() { + return new InstanceTemplatePrototypeInstanceTemplateByCatalogOffering(this); } /** * Adds an keys to keys. * * @param keys the new keys - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder addKeys(KeyIdentity keys) { com.ibm.cloud.sdk.core.util.Validator.notNull(keys, @@ -114,7 +116,7 @@ public Builder addKeys(KeyIdentity keys) { * Adds an volumeAttachments to volumeAttachments. * * @param volumeAttachments the new volumeAttachments - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder addVolumeAttachments(VolumeAttachmentPrototype volumeAttachments) { com.ibm.cloud.sdk.core.util.Validator.notNull(volumeAttachments, @@ -130,7 +132,7 @@ public Builder addVolumeAttachments(VolumeAttachmentPrototype volumeAttachments) * Adds an networkInterfaces to networkInterfaces. * * @param networkInterfaces the new networkInterfaces - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) { com.ibm.cloud.sdk.core.util.Validator.notNull(networkInterfaces, @@ -146,7 +148,7 @@ public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) * Set the availabilityPolicy. * * @param availabilityPolicy the availabilityPolicy - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder availabilityPolicy(InstanceAvailabilityPolicyPrototype availabilityPolicy) { this.availabilityPolicy = availabilityPolicy; @@ -157,7 +159,7 @@ public Builder availabilityPolicy(InstanceAvailabilityPolicyPrototype availabili * Set the defaultTrustedProfile. * * @param defaultTrustedProfile the defaultTrustedProfile - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defaultTrustedProfile) { this.defaultTrustedProfile = defaultTrustedProfile; @@ -169,7 +171,7 @@ public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defa * Existing keys will be replaced. * * @param keys the keys - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder keys(List keys) { this.keys = keys; @@ -180,7 +182,7 @@ public Builder keys(List keys) { * Set the metadataService. * * @param metadataService the metadataService - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder metadataService(InstanceMetadataServicePrototype metadataService) { this.metadataService = metadataService; @@ -191,7 +193,7 @@ public Builder metadataService(InstanceMetadataServicePrototype metadataService) * Set the name. * * @param name the name - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder name(String name) { this.name = name; @@ -202,7 +204,7 @@ public Builder name(String name) { * Set the placementTarget. * * @param placementTarget the placementTarget - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) { this.placementTarget = placementTarget; @@ -213,7 +215,7 @@ public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) * Set the profile. * * @param profile the profile - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder profile(InstanceProfileIdentity profile) { this.profile = profile; @@ -224,7 +226,7 @@ public Builder profile(InstanceProfileIdentity profile) { * Set the resourceGroup. * * @param resourceGroup the resourceGroup - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { this.resourceGroup = resourceGroup; @@ -235,7 +237,7 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { * Set the totalVolumeBandwidth. * * @param totalVolumeBandwidth the totalVolumeBandwidth - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { this.totalVolumeBandwidth = totalVolumeBandwidth; @@ -246,7 +248,7 @@ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { * Set the userData. * * @param userData the userData - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder userData(String userData) { this.userData = userData; @@ -258,7 +260,7 @@ public Builder userData(String userData) { * Existing volumeAttachments will be replaced. * * @param volumeAttachments the volumeAttachments - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder volumeAttachments(List volumeAttachments) { this.volumeAttachments = volumeAttachments; @@ -269,7 +271,7 @@ public Builder volumeAttachments(List volumeAttachmen * Set the vpc. * * @param vpc the vpc - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder vpc(VPCIdentity vpc) { this.vpc = vpc; @@ -280,7 +282,7 @@ public Builder vpc(VPCIdentity vpc) { * Set the bootVolumeAttachment. * * @param bootVolumeAttachment the bootVolumeAttachment - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment) { this.bootVolumeAttachment = bootVolumeAttachment; @@ -291,7 +293,7 @@ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageCont * Set the catalogOffering. * * @param catalogOffering the catalogOffering - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder catalogOffering(InstanceCatalogOfferingPrototype catalogOffering) { this.catalogOffering = catalogOffering; @@ -303,7 +305,7 @@ public Builder catalogOffering(InstanceCatalogOfferingPrototype catalogOffering) * Existing networkInterfaces will be replaced. * * @param networkInterfaces the networkInterfaces - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder networkInterfaces(List networkInterfaces) { this.networkInterfaces = networkInterfaces; @@ -314,7 +316,7 @@ public Builder networkInterfaces(List networkInterfac * Set the primaryNetworkInterface. * * @param primaryNetworkInterface the primaryNetworkInterface - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkInterface) { this.primaryNetworkInterface = primaryNetworkInterface; @@ -325,7 +327,7 @@ public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkI * Set the zone. * * @param zone the zone - * @return the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder zone(ZoneIdentity zone) { this.zone = zone; @@ -333,11 +335,13 @@ public Builder zone(ZoneIdentity zone) { } } - protected InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext() { } + protected InstanceTemplatePrototypeInstanceTemplateByCatalogOffering() { } - protected InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext(Builder builder) { + protected InstanceTemplatePrototypeInstanceTemplateByCatalogOffering(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.catalogOffering, "catalogOffering cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.primaryNetworkInterface, + "primaryNetworkInterface cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, "zone cannot be null"); availabilityPolicy = builder.availabilityPolicy; @@ -362,7 +366,7 @@ protected InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateCont /** * New builder. * - * @return a InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext builder + * @return a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImage.java similarity index 68% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImage.java index 238f594d24..101c082b67 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImage.java @@ -16,9 +16,9 @@ import java.util.List; /** - * InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext. + * Create an instance template that creates instances by using an image. */ -public class InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext extends InstanceTemplatePrototype { +public class InstanceTemplatePrototypeInstanceTemplateByImage extends InstanceTemplatePrototype { /** @@ -44,28 +44,28 @@ public static class Builder { private ZoneIdentity zone; /** - * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext instance. + * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceTemplateByImage instance. * - * @param instanceTemplatePrototypeInstanceByImageInstanceTemplateContext the instance to initialize the Builder with + * @param instanceTemplatePrototypeInstanceTemplateByImage the instance to initialize the Builder with */ - public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceByImageInstanceTemplateContext) { - this.availabilityPolicy = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.availabilityPolicy; - this.defaultTrustedProfile = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.defaultTrustedProfile; - this.keys = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.keys; - this.metadataService = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.metadataService; - this.name = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.name; - this.placementTarget = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.placementTarget; - this.profile = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.profile; - this.resourceGroup = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.resourceGroup; - this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.totalVolumeBandwidth; - this.userData = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.userData; - this.volumeAttachments = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.volumeAttachments; - this.vpc = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.vpc; - this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.bootVolumeAttachment; - this.image = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.image; - this.networkInterfaces = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.networkInterfaces; - this.primaryNetworkInterface = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.primaryNetworkInterface; - this.zone = instanceTemplatePrototypeInstanceByImageInstanceTemplateContext.zone; + public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceTemplateByImage) { + this.availabilityPolicy = instanceTemplatePrototypeInstanceTemplateByImage.availabilityPolicy; + this.defaultTrustedProfile = instanceTemplatePrototypeInstanceTemplateByImage.defaultTrustedProfile; + this.keys = instanceTemplatePrototypeInstanceTemplateByImage.keys; + this.metadataService = instanceTemplatePrototypeInstanceTemplateByImage.metadataService; + this.name = instanceTemplatePrototypeInstanceTemplateByImage.name; + this.placementTarget = instanceTemplatePrototypeInstanceTemplateByImage.placementTarget; + this.profile = instanceTemplatePrototypeInstanceTemplateByImage.profile; + this.resourceGroup = instanceTemplatePrototypeInstanceTemplateByImage.resourceGroup; + this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateByImage.totalVolumeBandwidth; + this.userData = instanceTemplatePrototypeInstanceTemplateByImage.userData; + this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateByImage.volumeAttachments; + this.vpc = instanceTemplatePrototypeInstanceTemplateByImage.vpc; + this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceTemplateByImage.bootVolumeAttachment; + this.image = instanceTemplatePrototypeInstanceTemplateByImage.image; + this.networkInterfaces = instanceTemplatePrototypeInstanceTemplateByImage.networkInterfaces; + this.primaryNetworkInterface = instanceTemplatePrototypeInstanceTemplateByImage.primaryNetworkInterface; + this.zone = instanceTemplatePrototypeInstanceTemplateByImage.zone; } /** @@ -78,27 +78,29 @@ public Builder() { * Instantiates a new builder with required properties. * * @param image the image + * @param primaryNetworkInterface the primaryNetworkInterface * @param zone the zone */ - public Builder(ImageIdentity image, ZoneIdentity zone) { + public Builder(ImageIdentity image, NetworkInterfacePrototype primaryNetworkInterface, ZoneIdentity zone) { this.image = image; + this.primaryNetworkInterface = primaryNetworkInterface; this.zone = zone; } /** - * Builds a InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext. + * Builds a InstanceTemplatePrototypeInstanceTemplateByImage. * - * @return the new InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext instance + * @return the new InstanceTemplatePrototypeInstanceTemplateByImage instance */ - public InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext build() { - return new InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext(this); + public InstanceTemplatePrototypeInstanceTemplateByImage build() { + return new InstanceTemplatePrototypeInstanceTemplateByImage(this); } /** * Adds an keys to keys. * * @param keys the new keys - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder addKeys(KeyIdentity keys) { com.ibm.cloud.sdk.core.util.Validator.notNull(keys, @@ -114,7 +116,7 @@ public Builder addKeys(KeyIdentity keys) { * Adds an volumeAttachments to volumeAttachments. * * @param volumeAttachments the new volumeAttachments - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder addVolumeAttachments(VolumeAttachmentPrototype volumeAttachments) { com.ibm.cloud.sdk.core.util.Validator.notNull(volumeAttachments, @@ -130,7 +132,7 @@ public Builder addVolumeAttachments(VolumeAttachmentPrototype volumeAttachments) * Adds an networkInterfaces to networkInterfaces. * * @param networkInterfaces the new networkInterfaces - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) { com.ibm.cloud.sdk.core.util.Validator.notNull(networkInterfaces, @@ -146,7 +148,7 @@ public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) * Set the availabilityPolicy. * * @param availabilityPolicy the availabilityPolicy - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder availabilityPolicy(InstanceAvailabilityPolicyPrototype availabilityPolicy) { this.availabilityPolicy = availabilityPolicy; @@ -157,7 +159,7 @@ public Builder availabilityPolicy(InstanceAvailabilityPolicyPrototype availabili * Set the defaultTrustedProfile. * * @param defaultTrustedProfile the defaultTrustedProfile - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defaultTrustedProfile) { this.defaultTrustedProfile = defaultTrustedProfile; @@ -169,7 +171,7 @@ public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defa * Existing keys will be replaced. * * @param keys the keys - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder keys(List keys) { this.keys = keys; @@ -180,7 +182,7 @@ public Builder keys(List keys) { * Set the metadataService. * * @param metadataService the metadataService - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder metadataService(InstanceMetadataServicePrototype metadataService) { this.metadataService = metadataService; @@ -191,7 +193,7 @@ public Builder metadataService(InstanceMetadataServicePrototype metadataService) * Set the name. * * @param name the name - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder name(String name) { this.name = name; @@ -202,7 +204,7 @@ public Builder name(String name) { * Set the placementTarget. * * @param placementTarget the placementTarget - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) { this.placementTarget = placementTarget; @@ -213,7 +215,7 @@ public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) * Set the profile. * * @param profile the profile - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder profile(InstanceProfileIdentity profile) { this.profile = profile; @@ -224,7 +226,7 @@ public Builder profile(InstanceProfileIdentity profile) { * Set the resourceGroup. * * @param resourceGroup the resourceGroup - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { this.resourceGroup = resourceGroup; @@ -235,7 +237,7 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { * Set the totalVolumeBandwidth. * * @param totalVolumeBandwidth the totalVolumeBandwidth - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { this.totalVolumeBandwidth = totalVolumeBandwidth; @@ -246,7 +248,7 @@ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { * Set the userData. * * @param userData the userData - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder userData(String userData) { this.userData = userData; @@ -258,7 +260,7 @@ public Builder userData(String userData) { * Existing volumeAttachments will be replaced. * * @param volumeAttachments the volumeAttachments - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder volumeAttachments(List volumeAttachments) { this.volumeAttachments = volumeAttachments; @@ -269,7 +271,7 @@ public Builder volumeAttachments(List volumeAttachmen * Set the vpc. * * @param vpc the vpc - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder vpc(VPCIdentity vpc) { this.vpc = vpc; @@ -280,7 +282,7 @@ public Builder vpc(VPCIdentity vpc) { * Set the bootVolumeAttachment. * * @param bootVolumeAttachment the bootVolumeAttachment - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment) { this.bootVolumeAttachment = bootVolumeAttachment; @@ -291,7 +293,7 @@ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageCont * Set the image. * * @param image the image - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder image(ImageIdentity image) { this.image = image; @@ -303,7 +305,7 @@ public Builder image(ImageIdentity image) { * Existing networkInterfaces will be replaced. * * @param networkInterfaces the networkInterfaces - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder networkInterfaces(List networkInterfaces) { this.networkInterfaces = networkInterfaces; @@ -314,7 +316,7 @@ public Builder networkInterfaces(List networkInterfac * Set the primaryNetworkInterface. * * @param primaryNetworkInterface the primaryNetworkInterface - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkInterface) { this.primaryNetworkInterface = primaryNetworkInterface; @@ -325,7 +327,7 @@ public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkI * Set the zone. * * @param zone the zone - * @return the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder zone(ZoneIdentity zone) { this.zone = zone; @@ -333,11 +335,13 @@ public Builder zone(ZoneIdentity zone) { } } - protected InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext() { } + protected InstanceTemplatePrototypeInstanceTemplateByImage() { } - protected InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext(Builder builder) { + protected InstanceTemplatePrototypeInstanceTemplateByImage(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.image, "image cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.primaryNetworkInterface, + "primaryNetworkInterface cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, "zone cannot be null"); availabilityPolicy = builder.availabilityPolicy; @@ -362,7 +366,7 @@ protected InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext(Builde /** * New builder. * - * @return a InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext builder + * @return a InstanceTemplatePrototypeInstanceTemplateByImage builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.java similarity index 66% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.java index 2a559f7368..66b8e1daa2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.java @@ -16,9 +16,9 @@ import java.util.List; /** - * InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext. + * Create an instance template that creates instances by using a snapshot. */ -public class InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext extends InstanceTemplatePrototype { +public class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot extends InstanceTemplatePrototype { /** @@ -43,27 +43,27 @@ public static class Builder { private ZoneIdentity zone; /** - * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext instance. + * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot instance. * - * @param instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext the instance to initialize the Builder with + * @param instanceTemplatePrototypeInstanceTemplateBySourceSnapshot the instance to initialize the Builder with */ - public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext) { - this.availabilityPolicy = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.availabilityPolicy; - this.defaultTrustedProfile = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.defaultTrustedProfile; - this.keys = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.keys; - this.metadataService = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.metadataService; - this.name = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.name; - this.placementTarget = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.placementTarget; - this.profile = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.profile; - this.resourceGroup = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.resourceGroup; - this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.totalVolumeBandwidth; - this.userData = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.userData; - this.volumeAttachments = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.volumeAttachments; - this.vpc = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.vpc; - this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.bootVolumeAttachment; - this.networkInterfaces = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.networkInterfaces; - this.primaryNetworkInterface = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.primaryNetworkInterface; - this.zone = instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.zone; + public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceTemplateBySourceSnapshot) { + this.availabilityPolicy = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.availabilityPolicy; + this.defaultTrustedProfile = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.defaultTrustedProfile; + this.keys = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.keys; + this.metadataService = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.metadataService; + this.name = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.name; + this.placementTarget = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.placementTarget; + this.profile = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.profile; + this.resourceGroup = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.resourceGroup; + this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.totalVolumeBandwidth; + this.userData = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.userData; + this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.volumeAttachments; + this.vpc = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.vpc; + this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.bootVolumeAttachment; + this.networkInterfaces = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.networkInterfaces; + this.primaryNetworkInterface = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.primaryNetworkInterface; + this.zone = instanceTemplatePrototypeInstanceTemplateBySourceSnapshot.zone; } /** @@ -76,27 +76,29 @@ public Builder() { * Instantiates a new builder with required properties. * * @param bootVolumeAttachment the bootVolumeAttachment + * @param primaryNetworkInterface the primaryNetworkInterface * @param zone the zone */ - public Builder(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment, ZoneIdentity zone) { + public Builder(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment, NetworkInterfacePrototype primaryNetworkInterface, ZoneIdentity zone) { this.bootVolumeAttachment = bootVolumeAttachment; + this.primaryNetworkInterface = primaryNetworkInterface; this.zone = zone; } /** - * Builds a InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext. + * Builds a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot. * - * @return the new InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext instance + * @return the new InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot instance */ - public InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext build() { - return new InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext(this); + public InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot build() { + return new InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(this); } /** * Adds an keys to keys. * * @param keys the new keys - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder addKeys(KeyIdentity keys) { com.ibm.cloud.sdk.core.util.Validator.notNull(keys, @@ -112,7 +114,7 @@ public Builder addKeys(KeyIdentity keys) { * Adds an volumeAttachments to volumeAttachments. * * @param volumeAttachments the new volumeAttachments - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder addVolumeAttachments(VolumeAttachmentPrototype volumeAttachments) { com.ibm.cloud.sdk.core.util.Validator.notNull(volumeAttachments, @@ -128,7 +130,7 @@ public Builder addVolumeAttachments(VolumeAttachmentPrototype volumeAttachments) * Adds an networkInterfaces to networkInterfaces. * * @param networkInterfaces the new networkInterfaces - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) { com.ibm.cloud.sdk.core.util.Validator.notNull(networkInterfaces, @@ -144,7 +146,7 @@ public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) * Set the availabilityPolicy. * * @param availabilityPolicy the availabilityPolicy - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder availabilityPolicy(InstanceAvailabilityPolicyPrototype availabilityPolicy) { this.availabilityPolicy = availabilityPolicy; @@ -155,7 +157,7 @@ public Builder availabilityPolicy(InstanceAvailabilityPolicyPrototype availabili * Set the defaultTrustedProfile. * * @param defaultTrustedProfile the defaultTrustedProfile - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defaultTrustedProfile) { this.defaultTrustedProfile = defaultTrustedProfile; @@ -167,7 +169,7 @@ public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defa * Existing keys will be replaced. * * @param keys the keys - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder keys(List keys) { this.keys = keys; @@ -178,7 +180,7 @@ public Builder keys(List keys) { * Set the metadataService. * * @param metadataService the metadataService - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder metadataService(InstanceMetadataServicePrototype metadataService) { this.metadataService = metadataService; @@ -189,7 +191,7 @@ public Builder metadataService(InstanceMetadataServicePrototype metadataService) * Set the name. * * @param name the name - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder name(String name) { this.name = name; @@ -200,7 +202,7 @@ public Builder name(String name) { * Set the placementTarget. * * @param placementTarget the placementTarget - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) { this.placementTarget = placementTarget; @@ -211,7 +213,7 @@ public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) * Set the profile. * * @param profile the profile - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder profile(InstanceProfileIdentity profile) { this.profile = profile; @@ -222,7 +224,7 @@ public Builder profile(InstanceProfileIdentity profile) { * Set the resourceGroup. * * @param resourceGroup the resourceGroup - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { this.resourceGroup = resourceGroup; @@ -233,7 +235,7 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { * Set the totalVolumeBandwidth. * * @param totalVolumeBandwidth the totalVolumeBandwidth - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { this.totalVolumeBandwidth = totalVolumeBandwidth; @@ -244,7 +246,7 @@ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { * Set the userData. * * @param userData the userData - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder userData(String userData) { this.userData = userData; @@ -256,7 +258,7 @@ public Builder userData(String userData) { * Existing volumeAttachments will be replaced. * * @param volumeAttachments the volumeAttachments - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder volumeAttachments(List volumeAttachments) { this.volumeAttachments = volumeAttachments; @@ -267,7 +269,7 @@ public Builder volumeAttachments(List volumeAttachmen * Set the vpc. * * @param vpc the vpc - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder vpc(VPCIdentity vpc) { this.vpc = vpc; @@ -278,7 +280,7 @@ public Builder vpc(VPCIdentity vpc) { * Set the bootVolumeAttachment. * * @param bootVolumeAttachment the bootVolumeAttachment - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment) { this.bootVolumeAttachment = bootVolumeAttachment; @@ -290,7 +292,7 @@ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceBySourceSna * Existing networkInterfaces will be replaced. * * @param networkInterfaces the networkInterfaces - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder networkInterfaces(List networkInterfaces) { this.networkInterfaces = networkInterfaces; @@ -301,7 +303,7 @@ public Builder networkInterfaces(List networkInterfac * Set the primaryNetworkInterface. * * @param primaryNetworkInterface the primaryNetworkInterface - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkInterface) { this.primaryNetworkInterface = primaryNetworkInterface; @@ -312,7 +314,7 @@ public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkI * Set the zone. * * @param zone the zone - * @return the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder zone(ZoneIdentity zone) { this.zone = zone; @@ -320,11 +322,13 @@ public Builder zone(ZoneIdentity zone) { } } - protected InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext() { } + protected InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() { } - protected InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext(Builder builder) { + protected InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.bootVolumeAttachment, "bootVolumeAttachment cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.primaryNetworkInterface, + "primaryNetworkInterface cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, "zone cannot be null"); availabilityPolicy = builder.availabilityPolicy; @@ -348,7 +352,7 @@ protected InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateConte /** * New builder. * - * @return a InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext builder + * @return a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplate.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.java similarity index 69% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplate.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.java index 156ce2ff44..613774ad11 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplate.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.java @@ -16,9 +16,9 @@ import java.util.List; /** - * InstanceTemplatePrototypeInstanceBySourceTemplate. + * Create an instance template from an existing instance template. */ -public class InstanceTemplatePrototypeInstanceBySourceTemplate extends InstanceTemplatePrototype { +public class InstanceTemplatePrototypeInstanceTemplateBySourceTemplate extends InstanceTemplatePrototype { /** @@ -46,30 +46,30 @@ public static class Builder { private ZoneIdentity zone; /** - * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceBySourceTemplate instance. + * Instantiates a new Builder from an existing InstanceTemplatePrototypeInstanceTemplateBySourceTemplate instance. * - * @param instanceTemplatePrototypeInstanceBySourceTemplate the instance to initialize the Builder with + * @param instanceTemplatePrototypeInstanceTemplateBySourceTemplate the instance to initialize the Builder with */ - public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceBySourceTemplate) { - this.availabilityPolicy = instanceTemplatePrototypeInstanceBySourceTemplate.availabilityPolicy; - this.defaultTrustedProfile = instanceTemplatePrototypeInstanceBySourceTemplate.defaultTrustedProfile; - this.keys = instanceTemplatePrototypeInstanceBySourceTemplate.keys; - this.metadataService = instanceTemplatePrototypeInstanceBySourceTemplate.metadataService; - this.name = instanceTemplatePrototypeInstanceBySourceTemplate.name; - this.placementTarget = instanceTemplatePrototypeInstanceBySourceTemplate.placementTarget; - this.profile = instanceTemplatePrototypeInstanceBySourceTemplate.profile; - this.resourceGroup = instanceTemplatePrototypeInstanceBySourceTemplate.resourceGroup; - this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceBySourceTemplate.totalVolumeBandwidth; - this.userData = instanceTemplatePrototypeInstanceBySourceTemplate.userData; - this.volumeAttachments = instanceTemplatePrototypeInstanceBySourceTemplate.volumeAttachments; - this.vpc = instanceTemplatePrototypeInstanceBySourceTemplate.vpc; - this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceBySourceTemplate.bootVolumeAttachment; - this.catalogOffering = instanceTemplatePrototypeInstanceBySourceTemplate.catalogOffering; - this.image = instanceTemplatePrototypeInstanceBySourceTemplate.image; - this.networkInterfaces = instanceTemplatePrototypeInstanceBySourceTemplate.networkInterfaces; - this.primaryNetworkInterface = instanceTemplatePrototypeInstanceBySourceTemplate.primaryNetworkInterface; - this.sourceTemplate = instanceTemplatePrototypeInstanceBySourceTemplate.sourceTemplate; - this.zone = instanceTemplatePrototypeInstanceBySourceTemplate.zone; + public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceTemplateBySourceTemplate) { + this.availabilityPolicy = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.availabilityPolicy; + this.defaultTrustedProfile = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.defaultTrustedProfile; + this.keys = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.keys; + this.metadataService = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.metadataService; + this.name = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.name; + this.placementTarget = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.placementTarget; + this.profile = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.profile; + this.resourceGroup = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.resourceGroup; + this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.totalVolumeBandwidth; + this.userData = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.userData; + this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.volumeAttachments; + this.vpc = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.vpc; + this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceTemplateBySourceTemplate.bootVolumeAttachment; + this.catalogOffering = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.catalogOffering; + this.image = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.image; + this.networkInterfaces = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.networkInterfaces; + this.primaryNetworkInterface = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.primaryNetworkInterface; + this.sourceTemplate = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.sourceTemplate; + this.zone = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.zone; } /** @@ -88,19 +88,19 @@ public Builder(InstanceTemplateIdentity sourceTemplate) { } /** - * Builds a InstanceTemplatePrototypeInstanceBySourceTemplate. + * Builds a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate. * - * @return the new InstanceTemplatePrototypeInstanceBySourceTemplate instance + * @return the new InstanceTemplatePrototypeInstanceTemplateBySourceTemplate instance */ - public InstanceTemplatePrototypeInstanceBySourceTemplate build() { - return new InstanceTemplatePrototypeInstanceBySourceTemplate(this); + public InstanceTemplatePrototypeInstanceTemplateBySourceTemplate build() { + return new InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(this); } /** * Adds an keys to keys. * * @param keys the new keys - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder addKeys(KeyIdentity keys) { com.ibm.cloud.sdk.core.util.Validator.notNull(keys, @@ -116,7 +116,7 @@ public Builder addKeys(KeyIdentity keys) { * Adds an volumeAttachments to volumeAttachments. * * @param volumeAttachments the new volumeAttachments - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder addVolumeAttachments(VolumeAttachmentPrototype volumeAttachments) { com.ibm.cloud.sdk.core.util.Validator.notNull(volumeAttachments, @@ -132,7 +132,7 @@ public Builder addVolumeAttachments(VolumeAttachmentPrototype volumeAttachments) * Adds an networkInterfaces to networkInterfaces. * * @param networkInterfaces the new networkInterfaces - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) { com.ibm.cloud.sdk.core.util.Validator.notNull(networkInterfaces, @@ -148,7 +148,7 @@ public Builder addNetworkInterfaces(NetworkInterfacePrototype networkInterfaces) * Set the availabilityPolicy. * * @param availabilityPolicy the availabilityPolicy - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder availabilityPolicy(InstanceAvailabilityPolicyPrototype availabilityPolicy) { this.availabilityPolicy = availabilityPolicy; @@ -159,7 +159,7 @@ public Builder availabilityPolicy(InstanceAvailabilityPolicyPrototype availabili * Set the defaultTrustedProfile. * * @param defaultTrustedProfile the defaultTrustedProfile - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defaultTrustedProfile) { this.defaultTrustedProfile = defaultTrustedProfile; @@ -171,7 +171,7 @@ public Builder defaultTrustedProfile(InstanceDefaultTrustedProfilePrototype defa * Existing keys will be replaced. * * @param keys the keys - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder keys(List keys) { this.keys = keys; @@ -182,7 +182,7 @@ public Builder keys(List keys) { * Set the metadataService. * * @param metadataService the metadataService - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder metadataService(InstanceMetadataServicePrototype metadataService) { this.metadataService = metadataService; @@ -193,7 +193,7 @@ public Builder metadataService(InstanceMetadataServicePrototype metadataService) * Set the name. * * @param name the name - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder name(String name) { this.name = name; @@ -204,7 +204,7 @@ public Builder name(String name) { * Set the placementTarget. * * @param placementTarget the placementTarget - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) { this.placementTarget = placementTarget; @@ -215,7 +215,7 @@ public Builder placementTarget(InstancePlacementTargetPrototype placementTarget) * Set the profile. * * @param profile the profile - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder profile(InstanceProfileIdentity profile) { this.profile = profile; @@ -226,7 +226,7 @@ public Builder profile(InstanceProfileIdentity profile) { * Set the resourceGroup. * * @param resourceGroup the resourceGroup - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { this.resourceGroup = resourceGroup; @@ -237,7 +237,7 @@ public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { * Set the totalVolumeBandwidth. * * @param totalVolumeBandwidth the totalVolumeBandwidth - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { this.totalVolumeBandwidth = totalVolumeBandwidth; @@ -248,7 +248,7 @@ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { * Set the userData. * * @param userData the userData - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder userData(String userData) { this.userData = userData; @@ -260,7 +260,7 @@ public Builder userData(String userData) { * Existing volumeAttachments will be replaced. * * @param volumeAttachments the volumeAttachments - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder volumeAttachments(List volumeAttachments) { this.volumeAttachments = volumeAttachments; @@ -271,7 +271,7 @@ public Builder volumeAttachments(List volumeAttachmen * Set the vpc. * * @param vpc the vpc - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder vpc(VPCIdentity vpc) { this.vpc = vpc; @@ -282,7 +282,7 @@ public Builder vpc(VPCIdentity vpc) { * Set the bootVolumeAttachment. * * @param bootVolumeAttachment the bootVolumeAttachment - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment) { this.bootVolumeAttachment = bootVolumeAttachment; @@ -293,7 +293,7 @@ public Builder bootVolumeAttachment(VolumeAttachmentPrototypeInstanceByImageCont * Set the catalogOffering. * * @param catalogOffering the catalogOffering - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder catalogOffering(InstanceCatalogOfferingPrototype catalogOffering) { this.catalogOffering = catalogOffering; @@ -304,7 +304,7 @@ public Builder catalogOffering(InstanceCatalogOfferingPrototype catalogOffering) * Set the image. * * @param image the image - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder image(ImageIdentity image) { this.image = image; @@ -316,7 +316,7 @@ public Builder image(ImageIdentity image) { * Existing networkInterfaces will be replaced. * * @param networkInterfaces the networkInterfaces - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder networkInterfaces(List networkInterfaces) { this.networkInterfaces = networkInterfaces; @@ -327,7 +327,7 @@ public Builder networkInterfaces(List networkInterfac * Set the primaryNetworkInterface. * * @param primaryNetworkInterface the primaryNetworkInterface - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkInterface) { this.primaryNetworkInterface = primaryNetworkInterface; @@ -338,7 +338,7 @@ public Builder primaryNetworkInterface(NetworkInterfacePrototype primaryNetworkI * Set the sourceTemplate. * * @param sourceTemplate the sourceTemplate - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder sourceTemplate(InstanceTemplateIdentity sourceTemplate) { this.sourceTemplate = sourceTemplate; @@ -349,7 +349,7 @@ public Builder sourceTemplate(InstanceTemplateIdentity sourceTemplate) { * Set the zone. * * @param zone the zone - * @return the InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder zone(ZoneIdentity zone) { this.zone = zone; @@ -357,9 +357,9 @@ public Builder zone(ZoneIdentity zone) { } } - protected InstanceTemplatePrototypeInstanceBySourceTemplate() { } + protected InstanceTemplatePrototypeInstanceTemplateBySourceTemplate() { } - protected InstanceTemplatePrototypeInstanceBySourceTemplate(Builder builder) { + protected InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceTemplate, "sourceTemplate cannot be null"); availabilityPolicy = builder.availabilityPolicy; @@ -386,7 +386,7 @@ protected InstanceTemplatePrototypeInstanceBySourceTemplate(Builder builder) { /** * New builder. * - * @return a InstanceTemplatePrototypeInstanceBySourceTemplate builder + * @return a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Key.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Key.java index c162954c9b..684219f831 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Key.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Key.java @@ -26,6 +26,8 @@ public class Key extends GenericModel { * The crypto-system used by this key. */ public interface Type { + /** ed25519. */ + String ED25519 = "ed25519"; /** rsa. */ String RSA = "rsa"; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPoliciesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPoliciesOptions.java index aadbd8440e..a566cb0eb5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPoliciesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPoliciesOptions.java @@ -163,7 +163,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -174,7 +174,7 @@ public String resourceGroupId() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -185,7 +185,7 @@ public String name() { /** * Gets the tag. * - * Filters the collection to resources with the exact tag value. + * Filters the collection to resources with an item in the `tags` property matching the exact specified tag. * * @return the tag */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyJobsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyJobsOptions.java index d58b4ab9e6..b40a2a36ff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyJobsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyJobsOptions.java @@ -19,6 +19,18 @@ */ public class ListBackupPolicyJobsOptions extends GenericModel { + /** + * Filters the collection to backup policy jobs with a `status` property matching the specified value. + */ + public interface Status { + /** failed. */ + String FAILED = "failed"; + /** running. */ + String RUNNING = "running"; + /** succeeded. */ + String SUCCEEDED = "succeeded"; + } + /** * Sorts the returned collection by the specified property name in ascending order. A `-` may be prepended to the name * to sort in descending order. For example, the value `-created_at` sorts the collection by the `created_at` property @@ -235,7 +247,7 @@ public String backupPolicyId() { /** * Gets the status. * - * Filters the collection to backup policy jobs with the specified status. + * Filters the collection to backup policy jobs with a `status` property matching the specified value. * * @return the status */ @@ -246,7 +258,8 @@ public String status() { /** * Gets the backupPolicyPlanId. * - * Filters the collection to backup policy jobs with the backup plan with the specified identifier. + * Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified + * identifier. * * @return the backupPolicyPlanId */ @@ -292,7 +305,7 @@ public String sort() { /** * Gets the sourceId. * - * Filters the collection to backup policy jobs with a source with the specified identifier. + * Filters the collection to backup policy jobs with a `source.id` property matching the specified identifier. * * @return the sourceId */ @@ -303,7 +316,8 @@ public String sourceId() { /** * Gets the targetSnapshotsId. * - * Filters the collection to resources with the target snapshot with the specified identifier. + * Filters the collection to backup policy jobs with an item in the `target_snapshots` property with an `id` property + * matching the specified identifier. * * @return the targetSnapshotsId */ @@ -314,7 +328,8 @@ public String targetSnapshotsId() { /** * Gets the targetSnapshotsCrn. * - * Filters the collection to backup policy jobs with the target snapshot with the specified CRN. + * Filters the collection to backup policy jobs with an item in the `target_snapshots` property with a `crn` property + * matching the specified CRN. * * @return the targetSnapshotsCrn */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyPlansOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyPlansOptions.java index 79dd7eaa3c..b1cb2a04fc 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyPlansOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyPlansOptions.java @@ -118,7 +118,7 @@ public String backupPolicyId() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptions.java index 48779bca6c..e395dc4f0f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptions.java @@ -238,7 +238,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -249,7 +249,7 @@ public String resourceGroupId() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -260,7 +260,7 @@ public String name() { /** * Gets the vpcId. * - * Filters the collection to resources in the VPC with the specified identifier. + * Filters the collection to resources with a `vpc.id` property matching the specified identifier. * * @return the vpcId */ @@ -271,7 +271,7 @@ public String vpcId() { /** * Gets the vpcCrn. * - * Filters the collection to resources in the VPC with the specified CRN. + * Filters the collection to resources with a `vpc.crn` property matching the specified CRN. * * @return the vpcCrn */ @@ -282,7 +282,7 @@ public String vpcCrn() { /** * Gets the vpcName. * - * Filters the collection to resources in the VPC with the exact specified name. + * Filters the collection to resources with a `vpc.name` property matching the exact specified name. * * @return the vpcName */ @@ -293,7 +293,8 @@ public String vpcName() { /** * Gets the networkInterfacesSubnetId. * - * Filters the collection to bare metal servers on the subnet with the specified identifier. + * Filters the collection to bare metal servers with an item in the `network_interfaces` property with a `subnet.id` + * property matching the specified identifier. * * @return the networkInterfacesSubnetId */ @@ -304,7 +305,8 @@ public String networkInterfacesSubnetId() { /** * Gets the networkInterfacesSubnetCrn. * - * Filters the collection to bare metal servers on the subnet with the specified CRN. + * Filters the collection to bare metal servers with an item in the `network_interfaces` property with a `subnet.crn` + * property matching the specified CRN. * * @return the networkInterfacesSubnetCrn */ @@ -315,7 +317,8 @@ public String networkInterfacesSubnetCrn() { /** * Gets the networkInterfacesSubnetName. * - * Filters the collection to bare metal servers on the subnet with the specified name. + * Filters the collection to bare metal servers with an item in the `network_interfaces` property with a `subnet.name` + * property matching the exact specified name. * * @return the networkInterfacesSubnetName */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptions.java index a0769231d8..b632b76e40 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptions.java @@ -163,7 +163,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -174,7 +174,7 @@ public String resourceGroupId() { /** * Gets the zoneName. * - * Filters the collection to resources in the zone with the exact specified name. + * Filters the collection to resources with a `zone.name` property matching the exact specified name. * * @return the zoneName */ @@ -185,7 +185,7 @@ public String zoneName() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptions.java index 300b5998ff..81b0209df7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptions.java @@ -156,7 +156,7 @@ public Builder newBuilder() { /** * Gets the dedicatedHostGroupId. * - * Filters the collection to dedicated host groups with the specified identifier. + * Filters the collection to dedicated hosts with a `group.id` property matching the specified identifier. * * @return the dedicatedHostGroupId */ @@ -189,7 +189,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -200,7 +200,7 @@ public String resourceGroupId() { /** * Gets the zoneName. * - * Filters the collection to resources in the zone with the exact specified name. + * Filters the collection to resources with a `zone.name` property matching the exact specified name. * * @return the zoneName */ @@ -211,7 +211,7 @@ public String zoneName() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ 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 3d470b8485..8b98f6da15 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 @@ -126,7 +126,7 @@ public Builder newBuilder() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -159,7 +159,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFloatingIpsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFloatingIpsOptions.java index d157b8ad4e..92e48c6148 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFloatingIpsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFloatingIpsOptions.java @@ -160,7 +160,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptions.java index de25aa8e8b..ea930dc556 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptions.java @@ -19,20 +19,6 @@ */ public class ListFlowLogCollectorsOptions extends GenericModel { - /** - * Filters the collection to flow log collectors that target the specified resource type. - */ - public interface TargetResourceType { - /** instance. */ - String INSTANCE = "instance"; - /** network_interface. */ - String NETWORK_INTERFACE = "network_interface"; - /** subnet. */ - String SUBNET = "subnet"; - /** vpc. */ - String VPC = "vpc"; - } - protected String start; protected Long limit; protected String resourceGroupId; @@ -237,7 +223,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -248,7 +234,7 @@ public String resourceGroupId() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -259,7 +245,7 @@ public String name() { /** * Gets the vpcId. * - * Filters the collection to resources in the VPC with the specified identifier. + * Filters the collection to resources with a `vpc.id` property matching the specified identifier. * * @return the vpcId */ @@ -270,7 +256,7 @@ public String vpcId() { /** * Gets the vpcCrn. * - * Filters the collection to resources in the VPC with the specified CRN. + * Filters the collection to resources with a `vpc.crn` property matching the specified CRN. * * @return the vpcCrn */ @@ -281,7 +267,7 @@ public String vpcCrn() { /** * Gets the vpcName. * - * Filters the collection to resources in the VPC with the exact specified name. + * Filters the collection to resources with a `vpc.name` property matching the exact specified name. * * @return the vpcName */ @@ -292,7 +278,7 @@ public String vpcName() { /** * Gets the targetId. * - * Filters the collection to flow log collectors that target the specified resource. + * Filters the collection to resources with a `target.id` property matching the specified identifier. * * @return the targetId */ @@ -303,7 +289,7 @@ public String targetId() { /** * Gets the targetResourceType. * - * Filters the collection to flow log collectors that target the specified resource type. + * Filters the collection to resources with a `target.resource_type` property matching the specified value. * * @return the targetResourceType */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageExportJobsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageExportJobsOptions.java index 853956d010..38f7a1fc6a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageExportJobsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageExportJobsOptions.java @@ -118,7 +118,7 @@ public String imageId() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptions.java index 9b29c51bca..ab887aea92 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptions.java @@ -12,6 +12,9 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; + import com.ibm.cloud.sdk.core.service.model.GenericModel; /** @@ -19,8 +22,25 @@ */ public class ListImagesOptions extends GenericModel { + public interface Status { + /** available. */ + String AVAILABLE = "available"; + /** deleting. */ + String DELETING = "deleting"; + /** deprecated. */ + String DEPRECATED = "deprecated"; + /** failed. */ + String FAILED = "failed"; + /** obsolete. */ + String OBSOLETE = "obsolete"; + /** pending. */ + String PENDING = "pending"; + /** unusable. */ + String UNUSABLE = "unusable"; + } + /** - * Filters the collection to images with the specified `visibility`. + * Filters the collection to images with a `visibility` property matching the specified value. */ public interface Visibility { /** private. */ @@ -33,6 +53,7 @@ public interface Visibility { protected Long limit; protected String resourceGroupId; protected String name; + protected List status; protected String visibility; /** @@ -43,6 +64,7 @@ public static class Builder { private Long limit; private String resourceGroupId; private String name; + private List status; private String visibility; /** @@ -55,6 +77,7 @@ private Builder(ListImagesOptions listImagesOptions) { this.limit = listImagesOptions.limit; this.resourceGroupId = listImagesOptions.resourceGroupId; this.name = listImagesOptions.name; + this.status = listImagesOptions.status; this.visibility = listImagesOptions.visibility; } @@ -73,6 +96,22 @@ public ListImagesOptions build() { return new ListImagesOptions(this); } + /** + * Adds an status to status. + * + * @param status the new status + * @return the ListImagesOptions builder + */ + public Builder addStatus(String status) { + com.ibm.cloud.sdk.core.util.Validator.notNull(status, + "status cannot be null"); + if (this.status == null) { + this.status = new ArrayList(); + } + this.status.add(status); + return this; + } + /** * Set the start. * @@ -117,6 +156,18 @@ public Builder name(String name) { return this; } + /** + * Set the status. + * Existing status will be replaced. + * + * @param status the status + * @return the ListImagesOptions builder + */ + public Builder status(List status) { + this.status = status; + return this; + } + /** * Set the visibility. * @@ -136,6 +187,7 @@ protected ListImagesOptions(Builder builder) { limit = builder.limit; resourceGroupId = builder.resourceGroupId; name = builder.name; + status = builder.status; visibility = builder.visibility; } @@ -173,7 +225,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -184,7 +236,7 @@ public String resourceGroupId() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -192,10 +244,21 @@ public String name() { return name; } + /** + * Gets the status. + * + * Filters the collection to images with a `status` property matching one of the specified comma-separated values. + * + * @return the status + */ + public List status() { + return status; + } + /** * Gets the visibility. * - * Filters the collection to images with the specified `visibility`. + * Filters the collection to images with a `visibility` property matching the specified value. * * @return the visibility */ 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 cca3b8dca2..006d0fd472 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 @@ -283,7 +283,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -294,7 +294,7 @@ public String resourceGroupId() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -305,7 +305,7 @@ public String name() { /** * Gets the vpcId. * - * Filters the collection to resources in the VPC with the specified identifier. + * Filters the collection to resources with a `vpc.id` property matching the specified identifier. * * @return the vpcId */ @@ -316,7 +316,7 @@ public String vpcId() { /** * Gets the vpcCrn. * - * Filters the collection to resources in the VPC with the specified CRN. + * Filters the collection to resources with a `vpc.crn` property matching the specified CRN. * * @return the vpcCrn */ @@ -327,7 +327,7 @@ public String vpcCrn() { /** * Gets the vpcName. * - * Filters the collection to resources in the VPC with the exact specified name. + * Filters the collection to resources with a `vpc.name` property matching the exact specified name. * * @return the vpcName */ @@ -338,7 +338,7 @@ public String vpcName() { /** * Gets the dedicatedHostId. * - * Filters the collection to instances on the dedicated host with the specified identifier. + * Filters the collection to instances with a `dedicated_host.id` property matching the specified identifier. * * @return the dedicatedHostId */ @@ -349,7 +349,7 @@ public String dedicatedHostId() { /** * Gets the dedicatedHostCrn. * - * Filters the collection to instances on the dedicated host with the specified CRN. + * Filters the collection to instances with a `dedicated_host.crn` property matching the specified CRN. * * @return the dedicatedHostCrn */ @@ -360,7 +360,7 @@ public String dedicatedHostCrn() { /** * Gets the dedicatedHostName. * - * Filters the collection to instances on the dedicated host with the specified name. + * Filters the collection to instances with a `dedicated_host.name` property matching the exact specified name. * * @return the dedicatedHostName */ @@ -371,7 +371,8 @@ public String dedicatedHostName() { /** * Gets the placementGroupId. * - * Filters the collection to instances in the placement group with the specified identifier. + * Filters the collection to instances with a `placement_target.id` property matching the specified placement group + * identifier. * * @return the placementGroupId */ @@ -382,7 +383,8 @@ public String placementGroupId() { /** * Gets the placementGroupCrn. * - * Filters the collection to instances in the placement group with the specified CRN. + * Filters the collection to instances with a `placement_target.crn` property matching the specified placement group + * CRN. * * @return the placementGroupCrn */ @@ -393,7 +395,8 @@ public String placementGroupCrn() { /** * Gets the placementGroupName. * - * Filters the collection to instances in the placement group with the specified name. + * Filters the collection to instances with a `placement_target.name` property matching the exact specified placement + * group name. * * @return the placementGroupName */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclRulesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclRulesOptions.java index a86092e907..28db30d127 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclRulesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclRulesOptions.java @@ -20,7 +20,7 @@ public class ListNetworkAclRulesOptions extends GenericModel { /** - * Filters the collection to rules with the specified direction. + * Filters the collection to rules with a `direction` property matching the specified value. */ public interface Direction { /** inbound. */ @@ -180,7 +180,7 @@ public Long limit() { /** * Gets the direction. * - * Filters the collection to rules with the specified direction. + * Filters the collection to rules with a `direction` property matching the specified value. * * @return the direction */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclsOptions.java index 4e0f966d83..ba0da0a77f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListNetworkAclsOptions.java @@ -133,7 +133,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPublicGatewaysOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPublicGatewaysOptions.java index fdda64a4f4..4570ef97ff 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPublicGatewaysOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListPublicGatewaysOptions.java @@ -133,7 +133,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptions.java index 62e608ff04..95bfcdd788 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptions.java @@ -178,7 +178,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -189,7 +189,7 @@ public String resourceGroupId() { /** * Gets the vpcId. * - * Filters the collection to resources in the VPC with the specified identifier. + * Filters the collection to resources with a `vpc.id` property matching the specified identifier. * * @return the vpcId */ @@ -200,7 +200,7 @@ public String vpcId() { /** * Gets the vpcCrn. * - * Filters the collection to resources in the VPC with the specified CRN. + * Filters the collection to resources with a `vpc.crn` property matching the specified CRN. * * @return the vpcCrn */ @@ -211,7 +211,7 @@ public String vpcCrn() { /** * Gets the vpcName. * - * Filters the collection to resources in the VPC with the exact specified name. + * Filters the collection to resources with a `vpc.name` property matching the exact specified name. * * @return the vpcName */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptions.java index 80a83b9c49..0cc2d74ae7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptions.java @@ -42,6 +42,14 @@ public interface Sort { protected String sourceImageCrn; protected String sort; protected String backupPolicyPlanId; + protected String copiesId; + protected String copiesName; + protected String copiesCrn; + protected String copiesRemoteRegionName; + protected String sourceSnapshotId; + protected String sourceSnapshotRemoteRegionName; + protected String sourceVolumeRemoteRegionName; + protected String sourceImageRemoteRegionName; protected String clonesZoneName; /** @@ -59,6 +67,14 @@ public static class Builder { private String sourceImageCrn; private String sort; private String backupPolicyPlanId; + private String copiesId; + private String copiesName; + private String copiesCrn; + private String copiesRemoteRegionName; + private String sourceSnapshotId; + private String sourceSnapshotRemoteRegionName; + private String sourceVolumeRemoteRegionName; + private String sourceImageRemoteRegionName; private String clonesZoneName; /** @@ -78,6 +94,14 @@ private Builder(ListSnapshotsOptions listSnapshotsOptions) { this.sourceImageCrn = listSnapshotsOptions.sourceImageCrn; this.sort = listSnapshotsOptions.sort; this.backupPolicyPlanId = listSnapshotsOptions.backupPolicyPlanId; + this.copiesId = listSnapshotsOptions.copiesId; + this.copiesName = listSnapshotsOptions.copiesName; + this.copiesCrn = listSnapshotsOptions.copiesCrn; + this.copiesRemoteRegionName = listSnapshotsOptions.copiesRemoteRegionName; + this.sourceSnapshotId = listSnapshotsOptions.sourceSnapshotId; + this.sourceSnapshotRemoteRegionName = listSnapshotsOptions.sourceSnapshotRemoteRegionName; + this.sourceVolumeRemoteRegionName = listSnapshotsOptions.sourceVolumeRemoteRegionName; + this.sourceImageRemoteRegionName = listSnapshotsOptions.sourceImageRemoteRegionName; this.clonesZoneName = listSnapshotsOptions.clonesZoneName; } @@ -217,6 +241,94 @@ public Builder backupPolicyPlanId(String backupPolicyPlanId) { return this; } + /** + * Set the copiesId. + * + * @param copiesId the copiesId + * @return the ListSnapshotsOptions builder + */ + public Builder copiesId(String copiesId) { + this.copiesId = copiesId; + return this; + } + + /** + * Set the copiesName. + * + * @param copiesName the copiesName + * @return the ListSnapshotsOptions builder + */ + public Builder copiesName(String copiesName) { + this.copiesName = copiesName; + return this; + } + + /** + * Set the copiesCrn. + * + * @param copiesCrn the copiesCrn + * @return the ListSnapshotsOptions builder + */ + public Builder copiesCrn(String copiesCrn) { + this.copiesCrn = copiesCrn; + return this; + } + + /** + * Set the copiesRemoteRegionName. + * + * @param copiesRemoteRegionName the copiesRemoteRegionName + * @return the ListSnapshotsOptions builder + */ + public Builder copiesRemoteRegionName(String copiesRemoteRegionName) { + this.copiesRemoteRegionName = copiesRemoteRegionName; + return this; + } + + /** + * Set the sourceSnapshotId. + * + * @param sourceSnapshotId the sourceSnapshotId + * @return the ListSnapshotsOptions builder + */ + public Builder sourceSnapshotId(String sourceSnapshotId) { + this.sourceSnapshotId = sourceSnapshotId; + return this; + } + + /** + * Set the sourceSnapshotRemoteRegionName. + * + * @param sourceSnapshotRemoteRegionName the sourceSnapshotRemoteRegionName + * @return the ListSnapshotsOptions builder + */ + public Builder sourceSnapshotRemoteRegionName(String sourceSnapshotRemoteRegionName) { + this.sourceSnapshotRemoteRegionName = sourceSnapshotRemoteRegionName; + return this; + } + + /** + * Set the sourceVolumeRemoteRegionName. + * + * @param sourceVolumeRemoteRegionName the sourceVolumeRemoteRegionName + * @return the ListSnapshotsOptions builder + */ + public Builder sourceVolumeRemoteRegionName(String sourceVolumeRemoteRegionName) { + this.sourceVolumeRemoteRegionName = sourceVolumeRemoteRegionName; + return this; + } + + /** + * Set the sourceImageRemoteRegionName. + * + * @param sourceImageRemoteRegionName the sourceImageRemoteRegionName + * @return the ListSnapshotsOptions builder + */ + public Builder sourceImageRemoteRegionName(String sourceImageRemoteRegionName) { + this.sourceImageRemoteRegionName = sourceImageRemoteRegionName; + return this; + } + /** * Set the clonesZoneName. * @@ -243,6 +355,14 @@ protected ListSnapshotsOptions(Builder builder) { sourceImageCrn = builder.sourceImageCrn; sort = builder.sort; backupPolicyPlanId = builder.backupPolicyPlanId; + copiesId = builder.copiesId; + copiesName = builder.copiesName; + copiesCrn = builder.copiesCrn; + copiesRemoteRegionName = builder.copiesRemoteRegionName; + sourceSnapshotId = builder.sourceSnapshotId; + sourceSnapshotRemoteRegionName = builder.sourceSnapshotRemoteRegionName; + sourceVolumeRemoteRegionName = builder.sourceVolumeRemoteRegionName; + sourceImageRemoteRegionName = builder.sourceImageRemoteRegionName; clonesZoneName = builder.clonesZoneName; } @@ -280,7 +400,7 @@ public Long limit() { /** * Gets the tag. * - * Filters the collection to resources with the exact tag value. + * Filters the collection to resources with an item in the `tags` property matching the exact specified tag. * * @return the tag */ @@ -291,7 +411,7 @@ public String tag() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -302,7 +422,7 @@ public String resourceGroupId() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -313,7 +433,7 @@ public String name() { /** * Gets the sourceVolumeId. * - * Filters the collection to resources with the source volume with the specified identifier. + * Filters the collection to resources with a `source_volume.id` property matching the specified identifier. * * @return the sourceVolumeId */ @@ -324,7 +444,7 @@ public String sourceVolumeId() { /** * Gets the sourceVolumeCrn. * - * Filters the collection to resources with the source volume with the specified CRN. + * Filters the collection to resources with a `source_volume.crn` property matching the specified CRN. * * @return the sourceVolumeCrn */ @@ -335,7 +455,7 @@ public String sourceVolumeCrn() { /** * Gets the sourceImageId. * - * Filters the collection to resources with the source image with the specified identifier. + * Filters the collection to resources with a `source_image.id` property matching the specified identifier. * * This parameter also supports the values `null` and `not:null` which filter the collection to resources which have * no source image or any existent source image, respectively. @@ -349,7 +469,7 @@ public String sourceImageId() { /** * Gets the sourceImageCrn. * - * Filters the collection to resources with the source volume with the specified CRN. + * Filters the collection to resources with a `source_image.crn` property matching the specified CRN. * * This parameter also supports the values `null` and `not:null` which filter the collection to resources which have * no source image or any existent source image, respectively. @@ -376,7 +496,8 @@ public String sort() { /** * Gets the backupPolicyPlanId. * - * Filters the collection to backup policy jobs with the backup plan with the specified identifier. + * Filters the collection to backup policy jobs with a `backup_policy_plan.id` property matching the specified + * identifier. * * @return the backupPolicyPlanId */ @@ -384,10 +505,106 @@ public String backupPolicyPlanId() { return backupPolicyPlanId; } + /** + * Gets the copiesId. + * + * Filters the collection to snapshots with an item in the `copies` property with an `id` property matching the + * specified identifier. + * + * @return the copiesId + */ + public String copiesId() { + return copiesId; + } + + /** + * Gets the copiesName. + * + * Filters the collection to snapshots with an item in the `copies` property with a `name` property matching the exact + * specified name. + * + * @return the copiesName + */ + public String copiesName() { + return copiesName; + } + + /** + * Gets the copiesCrn. + * + * Filters the collection to snapshots with an item in the `copies` property with an `id` property matching the + * specified CRN. + * + * @return the copiesCrn + */ + public String copiesCrn() { + return copiesCrn; + } + + /** + * Gets the copiesRemoteRegionName. + * + * Filters the collection to snapshots with an item in the `copies` property with a + * `remote.region.name` property matching the exact specified name. + * + * @return the copiesRemoteRegionName + */ + public String copiesRemoteRegionName() { + return copiesRemoteRegionName; + } + + /** + * Gets the sourceSnapshotId. + * + * Filters the collection to resources with a `source_snapshot.id` property matching the specified identifier. + * + * @return the sourceSnapshotId + */ + public String sourceSnapshotId() { + return sourceSnapshotId; + } + + /** + * Gets the sourceSnapshotRemoteRegionName. + * + * Filters the collection to resources with a `source_snapshot.remote.region.name` property matching the exact + * specified name. + * + * @return the sourceSnapshotRemoteRegionName + */ + public String sourceSnapshotRemoteRegionName() { + return sourceSnapshotRemoteRegionName; + } + + /** + * Gets the sourceVolumeRemoteRegionName. + * + * Filters the collection to resources with a `source_volume.remote.region.name` property matching the exact specified + * name. + * + * @return the sourceVolumeRemoteRegionName + */ + public String sourceVolumeRemoteRegionName() { + return sourceVolumeRemoteRegionName; + } + + /** + * Gets the sourceImageRemoteRegionName. + * + * Filters the collection to resources with a `source_image.remote.region.name` property matching the exact specified + * name. + * + * @return the sourceImageRemoteRegionName + */ + public String sourceImageRemoteRegionName() { + return sourceImageRemoteRegionName; + } + /** * Gets the clonesZoneName. * - * Filters the collection to resources with a clone in the specified zone. + * Filters the collection to snapshots with an item in the `clones` property with a `zone.name` property matching the + * exact specified name. * * @return the clonesZoneName */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptions.java index cba199b4e3..c2ee1481e3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptions.java @@ -163,7 +163,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -174,7 +174,7 @@ public String resourceGroupId() { /** * Gets the routingTableId. * - * Filters the collection to subnets attached to the routing table with the specified identifier. + * Filters the collection to subnets with a `routing_table.id` property matching the specified identifier. * * @return the routingTableId */ @@ -185,7 +185,7 @@ public String routingTableId() { /** * Gets the routingTableName. * - * Filters the collection to subnets attached to the routing table with the specified name. + * Filters the collection to subnets with a `routing_table.name` property matching the exact specified name. * * @return the routingTableName */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptions.java index 4fee96b733..f62995bc01 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptions.java @@ -20,7 +20,7 @@ public class ListVolumesOptions extends GenericModel { /** - * Filters the collection to volumes with the specified attachment state. + * Filters the collection to volumes with an `attachment_state` property matching the specified value. */ public interface AttachmentState { /** attached. */ @@ -32,7 +32,7 @@ public interface AttachmentState { } /** - * Filters the collection to resources with the specified encryption type. + * Filters the collection to resources with an `encryption` property matching the specified value. */ public interface Encryption { /** provider_managed. */ @@ -230,7 +230,7 @@ public Long limit() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -241,7 +241,7 @@ public String name() { /** * Gets the attachmentState. * - * Filters the collection to volumes with the specified attachment state. + * Filters the collection to volumes with an `attachment_state` property matching the specified value. * * @return the attachmentState */ @@ -252,7 +252,7 @@ public String attachmentState() { /** * Gets the encryption. * - * Filters the collection to resources with the specified encryption type. + * Filters the collection to resources with an `encryption` property matching the specified value. * * @return the encryption */ @@ -263,7 +263,8 @@ public String encryption() { /** * Gets the operatingSystemFamily. * - * Filters the collection to resources with the exact specified operating system family. + * Filters the collection to resources with an `operating_system.family` property matching the specified operating + * system family. * * This parameter also supports the values `null` and `not:null` which filter the collection to resources which have * no operating system or any operating system, respectively. @@ -277,7 +278,8 @@ public String operatingSystemFamily() { /** * Gets the operatingSystemArchitecture. * - * Filters the collection to resources with the exact specified operating system architecture. + * Filters the collection to resources with an `operating_system.architecture` property matching the specified + * operating system architecture. * * This parameter also supports the values `null` and `not:null` which filter the collection to resources which have * no operating system or any operating system, respectively. @@ -291,7 +293,7 @@ public String operatingSystemArchitecture() { /** * Gets the zoneName. * - * Filters the collection to resources in the zone with the exact specified name. + * Filters the collection to resources with a `zone.name` property matching the exact specified name. * * @return the zoneName */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptions.java index 4bc7bac5d7..52f9ab23f0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptions.java @@ -148,7 +148,7 @@ public String vpcId() { /** * Gets the zoneName. * - * Filters the collection to resources in the zone with the exact specified name. + * Filters the collection to resources with a `zone.name` property matching the exact specified name. * * @return the zoneName */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTablesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTablesOptions.java index 983c0b0d7f..1695f34299 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTablesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutingTablesOptions.java @@ -170,7 +170,7 @@ public Long limit() { /** * Gets the isDefault. * - * Filters the collection to routing tables with the specified `is_default` value. + * Filters the collection to routing tables with an `is_default` property matching the specified value. * * @return the isDefault */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcsOptions.java index 11512c9847..b38f7cb45a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpcsOptions.java @@ -148,7 +148,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -159,7 +159,7 @@ public String resourceGroupId() { /** * Gets the classicAccess. * - * Filters the collection to VPCs with the specified `classic_access` value. + * Filters the collection to VPCs with a `classic_access` property matching the specified value. * * @return the classicAccess */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptions.java index a8d1cc7cf8..0fbe3df0e9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptions.java @@ -19,6 +19,16 @@ */ public class ListVpnGatewayConnectionsOptions extends GenericModel { + /** + * Filters the collection to VPN gateway connections with a `status` property matching the specified value. + */ + public interface Status { + /** down. */ + String DOWN = "down"; + /** up. */ + String UP = "up"; + } + protected String vpnGatewayId; protected String status; @@ -118,7 +128,7 @@ public String vpnGatewayId() { /** * Gets the status. * - * Filters the collection to VPN gateway connections with the specified status. + * Filters the collection to VPN gateway connections with a `status` property matching the specified value. * * @return the status */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptions.java index e2997885d4..5663152a2e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewaysOptions.java @@ -32,7 +32,7 @@ public interface Sort { } /** - * Filters the collection to VPN gateways with the specified mode. + * Filters the collection to VPN gateways with a `mode` property matching the specified value. */ public interface Mode { /** policy. */ @@ -185,7 +185,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ @@ -209,7 +209,7 @@ public String sort() { /** * Gets the mode. * - * Filters the collection to VPN gateways with the specified mode. + * Filters the collection to VPN gateways with a `mode` property matching the specified value. * * @return the mode */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServersOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServersOptions.java index e5c0fb2083..71dca492e1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServersOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnServersOptions.java @@ -153,7 +153,7 @@ public Builder newBuilder() { /** * Gets the name. * - * Filters the collection to resources with the exact specified name. + * Filters the collection to resources with a `name` property matching the exact specified name. * * @return the name */ @@ -186,7 +186,7 @@ public Long limit() { /** * Gets the resourceGroupId. * - * Filters the collection to resources in the resource group with the specified identifier. + * Filters the collection to resources with a `resource_group.id` property matching the specified identifier. * * @return the resourceGroupId */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancer.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancer.java index 371fb4362d..f572ece1d4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancer.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancer.java @@ -83,6 +83,8 @@ public interface ResourceType { protected String hostname; protected String href; protected String id; + @SerializedName("instance_groups_supported") + protected Boolean instanceGroupsSupported; @SerializedName("is_public") protected Boolean isPublic; protected List listeners; @@ -183,6 +185,17 @@ public String getId() { return id; } + /** + * Gets the instanceGroupsSupported. + * + * Indicates whether this load balancer supports instance groups. + * + * @return the instanceGroupsSupported + */ + public Boolean isInstanceGroupsSupported() { + return instanceGroupsSupported; + } + /** * Gets the isPublic. * 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 ef61206fe9..1b0b92a681 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 @@ -22,6 +22,8 @@ public class LoadBalancerProfile extends GenericModel { protected String family; protected String href; + @SerializedName("instance_groups_supported") + protected LoadBalancerProfileInstanceGroupsSupported instanceGroupsSupported; @SerializedName("logging_supported") protected LoadBalancerProfileLoggingSupported loggingSupported; protected String name; @@ -56,6 +58,15 @@ public String getHref() { return href; } + /** + * Gets the instanceGroupsSupported. + * + * @return the instanceGroupsSupported + */ + public LoadBalancerProfileInstanceGroupsSupported getInstanceGroupsSupported() { + return instanceGroupsSupported; + } + /** * Gets the loggingSupported. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupported.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupported.java new file mode 100644 index 0000000000..0e2820b289 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupported.java @@ -0,0 +1,61 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * LoadBalancerProfileInstanceGroupsSupported. + * + * Classes which extend this class: + * - LoadBalancerProfileInstanceGroupsSupportedFixed + * - LoadBalancerProfileInstanceGroupsSupportedDependent + */ +public class LoadBalancerProfileInstanceGroupsSupported extends GenericModel { + + /** + * The type for this profile field. + */ + public interface Type { + /** fixed. */ + String FIXED = "fixed"; + } + + protected String type; + protected Boolean value; + + protected LoadBalancerProfileInstanceGroupsSupported() { } + + /** + * 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 Boolean isValue() { + return value; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedDependent.java new file mode 100644 index 0000000000..812175284a --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedDependent.java @@ -0,0 +1,31 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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 instance groups support for a load balancer with this profile depends on its configuration. + */ +public class LoadBalancerProfileInstanceGroupsSupportedDependent extends LoadBalancerProfileInstanceGroupsSupported { + + /** + * The type for this profile field. + */ + public interface Type { + /** dependent. */ + String DEPENDENT = "dependent"; + } + + + protected LoadBalancerProfileInstanceGroupsSupportedDependent() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedFixed.java new file mode 100644 index 0000000000..64d44b0562 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedFixed.java @@ -0,0 +1,31 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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 instance groups support for a load balancer with this profile. + */ +public class LoadBalancerProfileInstanceGroupsSupportedFixed extends LoadBalancerProfileInstanceGroupsSupported { + + /** + * The type for this profile field. + */ + public interface Type { + /** fixed. */ + String FIXED = "fixed"; + } + + + protected LoadBalancerProfileInstanceGroupsSupportedFixed() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollection.java index 835aa2fb57..5cf5f33571 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollection.java @@ -27,6 +27,8 @@ public class OperatingSystemCollection extends GenericModel { protected OperatingSystemCollectionNext next; @SerializedName("operating_systems") protected List operatingSystems; + @SerializedName("total_count") + protected Long totalCount; protected OperatingSystemCollection() { } @@ -74,5 +76,16 @@ public OperatingSystemCollectionNext getNext() { public List getOperatingSystems() { return operatingSystems; } + + /** + * 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/RegionIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentity.java new file mode 100644 index 0000000000..ca37a8b565 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentity.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * Identifies a region by a unique property. + * + * Classes which extend this class: + * - RegionIdentityByName + * - RegionIdentityByHref + */ +public class RegionIdentity extends GenericModel { + + protected String name; + protected String href; + + protected RegionIdentity() { } + + /** + * Gets the name. + * + * The globally unique name for this region. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Gets the href. + * + * The URL for this region. + * + * @return the href + */ + public String href() { + return href; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByHref.java new file mode 100644 index 0000000000..251fb9e04c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByHref.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * RegionIdentityByHref. + */ +public class RegionIdentityByHref extends RegionIdentity { + + + /** + * Builder. + */ + public static class Builder { + private String href; + + /** + * Instantiates a new Builder from an existing RegionIdentityByHref instance. + * + * @param regionIdentityByHref the instance to initialize the Builder with + */ + public Builder(RegionIdentity regionIdentityByHref) { + this.href = regionIdentityByHref.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 RegionIdentityByHref. + * + * @return the new RegionIdentityByHref instance + */ + public RegionIdentityByHref build() { + return new RegionIdentityByHref(this); + } + + /** + * Set the href. + * + * @param href the href + * @return the RegionIdentityByHref builder + */ + public Builder href(String href) { + this.href = href; + return this; + } + } + + protected RegionIdentityByHref() { } + + protected RegionIdentityByHref(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, + "href cannot be null"); + href = builder.href; + } + + /** + * New builder. + * + * @return a RegionIdentityByHref builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByName.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByName.java new file mode 100644 index 0000000000..607e98da7e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByName.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * RegionIdentityByName. + */ +public class RegionIdentityByName extends RegionIdentity { + + + /** + * Builder. + */ + public static class Builder { + private String name; + + /** + * Instantiates a new Builder from an existing RegionIdentityByName instance. + * + * @param regionIdentityByName the instance to initialize the Builder with + */ + public Builder(RegionIdentity regionIdentityByName) { + this.name = regionIdentityByName.name; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param name the name + */ + public Builder(String name) { + this.name = name; + } + + /** + * Builds a RegionIdentityByName. + * + * @return the new RegionIdentityByName instance + */ + public RegionIdentityByName build() { + return new RegionIdentityByName(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the RegionIdentityByName builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + } + + protected RegionIdentityByName() { } + + protected RegionIdentityByName(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, + "name cannot be null"); + name = builder.name; + } + + /** + * New builder. + * + * @return a RegionIdentityByName builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContext.java new file mode 100644 index 0000000000..0563195908 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContext.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * RouteCollectionVPCContext. + */ +public class RouteCollectionVPCContext extends GenericModel { + + protected RouteCollectionVPCContextFirst first; + protected Long limit; + protected RouteCollectionVPCContextNext next; + protected List routes; + @SerializedName("total_count") + protected Long totalCount; + + protected RouteCollectionVPCContext() { } + + /** + * Gets the first. + * + * A link to the first page of resources. + * + * @return the first + */ + public RouteCollectionVPCContextFirst 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 RouteCollectionVPCContextNext getNext() { + return next; + } + + /** + * Gets the routes. + * + * Collection of routes. + * + * @return the routes + */ + public List getRoutes() { + return routes; + } + + /** + * 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/RouteCollectionVPCContextFirst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextFirst.java new file mode 100644 index 0000000000..59da6fd17a --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextFirst.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * A link to the first page of resources. + */ +public class RouteCollectionVPCContextFirst extends GenericModel { + + protected String href; + + protected RouteCollectionVPCContextFirst() { } + + /** + * Gets the href. + * + * The URL for a page of resources. + * + * @return the href + */ + public String getHref() { + return href; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextNext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextNext.java new file mode 100644 index 0000000000..c977eddf35 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextNext.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * A link to the next page of resources. This property is present for all pages except the last page. + */ +public class RouteCollectionVPCContextNext extends GenericModel { + + protected String href; + + protected RouteCollectionVPCContextNext() { } + + /** + * Gets the href. + * + * The URL for a page of resources. + * + * @return the href + */ + public String getHref() { + return href; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextRoutesItem.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextRoutesItem.java new file mode 100644 index 0000000000..fd807e3506 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextRoutesItem.java @@ -0,0 +1,247 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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 com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * RouteCollectionVPCContextRoutesItem. + */ +public class RouteCollectionVPCContextRoutesItem extends GenericModel { + + /** + * The action to perform with a packet matching the route: + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + * - `deliver`: deliver the packet to the specified `next_hop` + * - `drop`: drop the packet. + */ + public interface Action { + /** delegate. */ + String DELEGATE = "delegate"; + /** delegate_vpc. */ + String DELEGATE_VPC = "delegate_vpc"; + /** deliver. */ + String DELIVER = "deliver"; + /** drop. */ + String DROP = "drop"; + } + + /** + * The lifecycle state of the route. + */ + 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 origin of this route: + * - `service`: route was directly created by a service + * - `user`: route was directly created by a user + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + * unexpected property value was encountered. + */ + public interface Origin { + /** service. */ + String SERVICE = "service"; + /** user. */ + String USER = "user"; + } + + protected String action; + @SerializedName("created_at") + protected Date createdAt; + protected RouteCreator creator; + protected String destination; + protected String href; + protected String id; + @SerializedName("lifecycle_state") + protected String lifecycleState; + protected String name; + @SerializedName("next_hop") + protected RouteNextHop nextHop; + protected String origin; + protected Long priority; + protected ZoneReference zone; + + protected RouteCollectionVPCContextRoutesItem() { } + + /** + * Gets the action. + * + * The action to perform with a packet matching the route: + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + * - `deliver`: deliver the packet to the specified `next_hop` + * - `drop`: drop the packet. + * + * @return the action + */ + public String getAction() { + return action; + } + + /** + * Gets the createdAt. + * + * The date and time that the route was created. + * + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * Gets the creator. + * + * If present, the resource that created the route. Routes with this property present cannot + * be directly deleted. All routes with an `origin` of `service` will have this property set, + * and future `origin` values may also have this property set. + * + * @return the creator + */ + public RouteCreator getCreator() { + return creator; + } + + /** + * Gets the destination. + * + * The destination of the route. + * + * @return the destination + */ + public String getDestination() { + return destination; + } + + /** + * Gets the href. + * + * The URL for this route. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the id. + * + * The unique identifier for this route. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the lifecycleState. + * + * The lifecycle state of the route. + * + * @return the lifecycleState + */ + public String getLifecycleState() { + return lifecycleState; + } + + /** + * Gets the name. + * + * The name for this route. The name is unique across all routes in the routing table. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the nextHop. + * + * If `action` is `deliver`, the next hop that packets will be delivered to. For + * other `action` values, its `address` will be `0.0.0.0`. + * + * @return the nextHop + */ + public RouteNextHop getNextHop() { + return nextHop; + } + + /** + * Gets the origin. + * + * The origin of this route: + * - `service`: route was directly created by a service + * - `user`: route was directly created by a user + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + * unexpected property value was encountered. + * + * @return the origin + */ + public String getOrigin() { + return origin; + } + + /** + * Gets the priority. + * + * The priority of this route. Smaller values have higher priority. + * + * If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + * priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + * distributed between them. + * + * @return the priority + */ + public Long getPriority() { + return priority; + } + + /** + * Gets the zone. + * + * The zone the route applies to. (Traffic from subnets in this zone will be + * subject to this route.). + * + * @return the zone + */ + public ZoneReference getZone() { + return zone; + } +} + 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 60cb1ed61f..e3d9e1d85e 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 @@ -181,7 +181,7 @@ public Long getType() { /** * Gets the portMax. * - * The inclusive upper bound of TCP/UDP port range. + * The inclusive upper bound of TCP/UDP destination port range. * * @return the portMax */ @@ -192,7 +192,7 @@ public Long getPortMax() { /** * Gets the portMin. * - * The inclusive lower bound of TCP/UDP port range. + * The inclusive lower bound of TCP/UDP destination port range. * * @return the portMin */ 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 418f0d5c39..310c66bdeb 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 @@ -235,7 +235,8 @@ public String ipVersion() { /** * Gets the portMax. * - * The inclusive upper bound of the protocol port range. If set, `port_min` must also be set, and must not be larger. + * The inclusive upper bound of the protocol destination port range. If set, `port_min` must also be set, and must not + * be larger. * * Specify `null` to remove an existing upper bound. * @@ -248,7 +249,8 @@ public Long portMax() { /** * Gets the portMin. * - * The inclusive lower bound of the protocol port range. If set, `port_max` must also be set, and must not be smaller. + * The inclusive lower bound of the protocol destination port range. If set, `port_max` must also be set, and must not + * be smaller. * * Specify `null` to remove an existing lower bound. * 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 33e940df81..a791841ef6 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 @@ -163,10 +163,10 @@ public Long type() { /** * Gets the portMax. * - * The inclusive upper bound of TCP/UDP port range. + * The inclusive upper bound of TCP/UDP destination port range. * - * If specified, `port_min` must also be specified, and must not be larger. If unspecified, `port_min` must also be - * unspecified, allowing traffic on all ports. + * If specified, `port_min` must also be specified, and must not be larger. If unspecified, + * `port_min` must also be unspecified, allowing traffic on all destination ports. * * @return the portMax */ @@ -177,10 +177,10 @@ public Long portMax() { /** * Gets the portMin. * - * The inclusive lower bound of TCP/UDP port range + * The inclusive lower bound of TCP/UDP destination port range * * If specified, `port_max` must also be specified, and must not be smaller. If unspecified, `port_max` must also be - * unspecified, allowing traffic on all ports. + * unspecified, allowing traffic on all destination ports. * * @return the portMin */ 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 cc488711a3..6d3dd7b434 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 @@ -15,8 +15,8 @@ /** * A rule specifying the TCP or UDP traffic to allow. * - * Either both `port_min` and `port_max` will be present, or neither. When neither is present, all ports are allowed for - * the protocol. When both have the same value, that single port is allowed. + * Either both `port_min` and `port_max` will be present, or neither. When neither is present, all destination ports are + * allowed for the protocol. When both have the same value, that single destination port is allowed. */ public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP extends SecurityGroupRulePrototype { 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 7b846ee432..1bb6d12694 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 @@ -15,8 +15,8 @@ /** * A rule specifying the TCP or UDP traffic to allow. * - * Either both `port_min` and `port_max` will be present, or neither. When neither is present, all ports are allowed for - * the protocol. When both have the same value, that single port is allowed. + * Either both `port_min` and `port_max` will be present, or neither. When neither is present, all destination ports are + * allowed for the protocol. When both have the same value, that single destination port is allowed. */ public class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP extends SecurityGroupRule { 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 596cbf2147..78a7ff17d7 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 @@ -67,6 +67,7 @@ public interface ResourceType { @SerializedName("captured_at") protected Date capturedAt; protected List clones; + protected List copies; @SerializedName("created_at") protected Date createdAt; protected String crn; @@ -92,6 +93,8 @@ public interface ResourceType { protected Long size; @SerializedName("source_image") protected ImageReference sourceImage; + @SerializedName("source_snapshot") + protected SnapshotSourceSnapshot sourceSnapshot; @SerializedName("source_volume") protected VolumeReference sourceVolume; @SerializedName("user_tags") @@ -146,6 +149,17 @@ public List getClones() { return clones; } + /** + * Gets the copies. + * + * The copies of this snapshot. + * + * @return the copies + */ + public List getCopies() { + return copies; + } + /** * Gets the createdAt. * @@ -330,6 +344,17 @@ public ImageReference getSourceImage() { return sourceImage; } + /** + * Gets the sourceSnapshot. + * + * If present, the source snapshot this snapshot was created from. + * + * @return the sourceSnapshot + */ + public SnapshotSourceSnapshot getSourceSnapshot() { + return sourceSnapshot; + } + /** * Gets the sourceVolume. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCopiesItem.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCopiesItem.java new file mode 100644 index 0000000000..e6742bf201 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCopiesItem.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * SnapshotCopiesItem. + */ +public class SnapshotCopiesItem extends GenericModel { + + /** + * The resource type. + */ + public interface ResourceType { + /** snapshot. */ + String SNAPSHOT = "snapshot"; + } + + protected String crn; + protected SnapshotReferenceDeleted deleted; + protected String href; + protected String id; + protected String name; + protected SnapshotRemote remote; + @SerializedName("resource_type") + protected String resourceType; + + protected SnapshotCopiesItem() { } + + /** + * Gets the crn. + * + * The CRN for the copied snapshot. + * + * @return the crn + */ + public String getCrn() { + return crn; + } + + /** + * Gets the deleted. + * + * If present, this property indicates the referenced resource has been deleted, and provides + * some supplementary information. + * + * @return the deleted + */ + public SnapshotReferenceDeleted getDeleted() { + return deleted; + } + + /** + * Gets the href. + * + * The URL for the copied snapshot. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the id. + * + * The unique identifier for the copied snapshot. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the name. + * + * The name for the copied snapshot. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the remote. + * + * If present, this property indicates that the resource associated with this reference + * is remote and therefore may not be directly retrievable. + * + * @return the remote + */ + public SnapshotRemote getRemote() { + return remote; + } + + /** + * 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/SnapshotPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java index 607d3b0519..9eec8c9ca8 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 @@ -22,6 +22,7 @@ * * Classes which extend this class: * - SnapshotPrototypeSnapshotBySourceVolume + * - SnapshotPrototypeSnapshotBySourceSnapshot */ public class SnapshotPrototype extends GenericModel { @@ -33,6 +34,10 @@ public class SnapshotPrototype extends GenericModel { protected List userTags; @SerializedName("source_volume") protected VolumeIdentity sourceVolume; + @SerializedName("encryption_key") + protected EncryptionKeyIdentity encryptionKey; + @SerializedName("source_snapshot") + protected SnapshotIdentityByCRN sourceSnapshot; protected SnapshotPrototype() { } @@ -92,5 +97,36 @@ public List userTags() { public VolumeIdentity sourceVolume() { return sourceVolume; } + + /** + * Gets the encryptionKey. + * + * The root key to use to wrap the data encryption key for this snapshot. + * + * A key must be specified if and only if the source snapshot has an `encryption` type of + * `user_managed`. To maximize snapshot availability and sharing of snapshot data, specify + * a key in the same region as the new snapshot, and use the same encryption key for all + * snapshots using the same source volume. + * + * The specified key may be in a different account, subject to IAM policies. + * + * @return the encryptionKey + */ + public EncryptionKeyIdentity encryptionKey() { + return encryptionKey; + } + + /** + * Gets the sourceSnapshot. + * + * The source snapshot (in another region) to create this snapshot from. + * The specified snapshot must not already be the source of another snapshot in this + * region. + * + * @return the sourceSnapshot + */ + public SnapshotIdentityByCRN sourceSnapshot() { + return sourceSnapshot; + } } 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 new file mode 100644 index 0000000000..b896d5d08e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshot.java @@ -0,0 +1,196 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * SnapshotPrototypeSnapshotBySourceSnapshot. + */ +public class SnapshotPrototypeSnapshotBySourceSnapshot extends SnapshotPrototype { + + + /** + * Builder. + */ + public static class Builder { + private List clones; + private String name; + private ResourceGroupIdentity resourceGroup; + private List userTags; + private EncryptionKeyIdentity encryptionKey; + private SnapshotIdentityByCRN sourceSnapshot; + + /** + * Instantiates a new Builder from an existing SnapshotPrototypeSnapshotBySourceSnapshot instance. + * + * @param snapshotPrototypeSnapshotBySourceSnapshot the instance to initialize the Builder with + */ + public Builder(SnapshotPrototype snapshotPrototypeSnapshotBySourceSnapshot) { + this.clones = snapshotPrototypeSnapshotBySourceSnapshot.clones; + this.name = snapshotPrototypeSnapshotBySourceSnapshot.name; + this.resourceGroup = snapshotPrototypeSnapshotBySourceSnapshot.resourceGroup; + this.userTags = snapshotPrototypeSnapshotBySourceSnapshot.userTags; + this.encryptionKey = snapshotPrototypeSnapshotBySourceSnapshot.encryptionKey; + this.sourceSnapshot = snapshotPrototypeSnapshotBySourceSnapshot.sourceSnapshot; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param sourceSnapshot the sourceSnapshot + */ + public Builder(SnapshotIdentityByCRN sourceSnapshot) { + this.sourceSnapshot = sourceSnapshot; + } + + /** + * Builds a SnapshotPrototypeSnapshotBySourceSnapshot. + * + * @return the new SnapshotPrototypeSnapshotBySourceSnapshot instance + */ + public SnapshotPrototypeSnapshotBySourceSnapshot build() { + return new SnapshotPrototypeSnapshotBySourceSnapshot(this); + } + + /** + * Adds an clones to clones. + * + * @param clones the new clones + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder addClones(SnapshotClonePrototype clones) { + com.ibm.cloud.sdk.core.util.Validator.notNull(clones, + "clones cannot be null"); + if (this.clones == null) { + this.clones = new ArrayList(); + } + this.clones.add(clones); + return this; + } + + /** + * Adds an userTags to userTags. + * + * @param userTags the new userTags + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder addUserTags(String userTags) { + com.ibm.cloud.sdk.core.util.Validator.notNull(userTags, + "userTags cannot be null"); + if (this.userTags == null) { + this.userTags = new ArrayList(); + } + this.userTags.add(userTags); + return this; + } + + /** + * Set the clones. + * Existing clones will be replaced. + * + * @param clones the clones + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder clones(List clones) { + this.clones = clones; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Set the userTags. + * Existing userTags will be replaced. + * + * @param userTags the userTags + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder userTags(List userTags) { + this.userTags = userTags; + return this; + } + + /** + * Set the encryptionKey. + * + * @param encryptionKey the encryptionKey + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder encryptionKey(EncryptionKeyIdentity encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Set the sourceSnapshot. + * + * @param sourceSnapshot the sourceSnapshot + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder sourceSnapshot(SnapshotIdentityByCRN sourceSnapshot) { + this.sourceSnapshot = sourceSnapshot; + return this; + } + } + + protected SnapshotPrototypeSnapshotBySourceSnapshot() { } + + protected SnapshotPrototypeSnapshotBySourceSnapshot(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceSnapshot, + "sourceSnapshot cannot be null"); + clones = builder.clones; + name = builder.name; + resourceGroup = builder.resourceGroup; + userTags = builder.userTags; + encryptionKey = builder.encryptionKey; + sourceSnapshot = builder.sourceSnapshot; + } + + /** + * New builder. + * + * @return a SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReference.java index d197041c93..bf432434fd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReference.java @@ -33,6 +33,7 @@ public interface ResourceType { protected String href; protected String id; protected String name; + protected SnapshotRemote remote; @SerializedName("resource_type") protected String resourceType; @@ -94,6 +95,18 @@ public String getName() { return name; } + /** + * Gets the remote. + * + * If present, this property indicates that the resource associated with this reference + * is remote and therefore may not be directly retrievable. + * + * @return the remote + */ + public SnapshotRemote getRemote() { + return remote; + } + /** * Gets the resourceType. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotRemote.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotRemote.java new file mode 100644 index 0000000000..92fe7195b4 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotRemote.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * If present, this property indicates that the resource associated with this reference is remote and therefore may not + * be directly retrievable. + */ +public class SnapshotRemote extends GenericModel { + + protected RegionReference region; + + protected SnapshotRemote() { } + + /** + * Gets the region. + * + * If present, this property indicates that the referenced resource is remote to this + * region, and identifies the native region. + * + * @return the region + */ + public RegionReference getRegion() { + return region; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotSourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotSourceSnapshot.java new file mode 100644 index 0000000000..98d9b83c46 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotSourceSnapshot.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * If present, the source snapshot this snapshot was created from. + */ +public class SnapshotSourceSnapshot extends GenericModel { + + /** + * The resource type. + */ + public interface ResourceType { + /** snapshot. */ + String SNAPSHOT = "snapshot"; + } + + protected String crn; + protected SnapshotReferenceDeleted deleted; + protected String href; + protected String id; + protected String name; + protected SnapshotRemote remote; + @SerializedName("resource_type") + protected String resourceType; + + protected SnapshotSourceSnapshot() { } + + /** + * Gets the crn. + * + * The CRN of the source snapshot. + * + * @return the crn + */ + public String getCrn() { + return crn; + } + + /** + * Gets the deleted. + * + * If present, this property indicates the referenced resource has been deleted, and provides + * some supplementary information. + * + * @return the deleted + */ + public SnapshotReferenceDeleted getDeleted() { + return deleted; + } + + /** + * Gets the href. + * + * The URL for the source snapshot. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the id. + * + * The unique identifier for the source snapshot. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the name. + * + * The name for the source snapshot. The name is unique across all snapshots in the source snapshot's native region. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the remote. + * + * If present, this property indicates that the resource associated with this reference + * is remote and therefore may not be directly retrievable. + * + * @return the remote + */ + public SnapshotRemote getRemote() { + return remote; + } + + /** + * 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/UpdateVpcRouteResponse.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteResponse.java new file mode 100644 index 0000000000..8b391de9c7 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteResponse.java @@ -0,0 +1,247 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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 com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * UpdateVpcRouteResponse. + */ +public class UpdateVpcRouteResponse extends GenericModel { + + /** + * The action to perform with a packet matching the route: + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + * - `deliver`: deliver the packet to the specified `next_hop` + * - `drop`: drop the packet. + */ + public interface Action { + /** delegate. */ + String DELEGATE = "delegate"; + /** delegate_vpc. */ + String DELEGATE_VPC = "delegate_vpc"; + /** deliver. */ + String DELIVER = "deliver"; + /** drop. */ + String DROP = "drop"; + } + + /** + * The lifecycle state of the route. + */ + 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 origin of this route: + * - `service`: route was directly created by a service + * - `user`: route was directly created by a user + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + * unexpected property value was encountered. + */ + public interface Origin { + /** service. */ + String SERVICE = "service"; + /** user. */ + String USER = "user"; + } + + protected String action; + @SerializedName("created_at") + protected Date createdAt; + protected RouteCreator creator; + protected String destination; + protected String href; + protected String id; + @SerializedName("lifecycle_state") + protected String lifecycleState; + protected String name; + @SerializedName("next_hop") + protected RouteNextHop nextHop; + protected String origin; + protected Long priority; + protected ZoneReference zone; + + protected UpdateVpcRouteResponse() { } + + /** + * Gets the action. + * + * The action to perform with a packet matching the route: + * - `delegate`: delegate to system-provided routes + * - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound routes + * - `deliver`: deliver the packet to the specified `next_hop` + * - `drop`: drop the packet. + * + * @return the action + */ + public String getAction() { + return action; + } + + /** + * Gets the createdAt. + * + * The date and time that the route was created. + * + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * Gets the creator. + * + * If present, the resource that created the route. Routes with this property present cannot + * be directly deleted. All routes with an `origin` of `service` will have this property set, + * and future `origin` values may also have this property set. + * + * @return the creator + */ + public RouteCreator getCreator() { + return creator; + } + + /** + * Gets the destination. + * + * The destination of the route. + * + * @return the destination + */ + public String getDestination() { + return destination; + } + + /** + * Gets the href. + * + * The URL for this route. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the id. + * + * The unique identifier for this route. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the lifecycleState. + * + * The lifecycle state of the route. + * + * @return the lifecycleState + */ + public String getLifecycleState() { + return lifecycleState; + } + + /** + * Gets the name. + * + * The name for this route. The name is unique across all routes in the routing table. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the nextHop. + * + * If `action` is `deliver`, the next hop that packets will be delivered to. For + * other `action` values, its `address` will be `0.0.0.0`. + * + * @return the nextHop + */ + public RouteNextHop getNextHop() { + return nextHop; + } + + /** + * Gets the origin. + * + * The origin of this route: + * - `service`: route was directly created by a service + * - `user`: route was directly created by a user + * + * The enumerated values for this property are expected to expand in the future. When processing this property, check + * for and log unknown values. Optionally halt processing and surface the error, or bypass the route on which the + * unexpected property value was encountered. + * + * @return the origin + */ + public String getOrigin() { + return origin; + } + + /** + * Gets the priority. + * + * The priority of this route. Smaller values have higher priority. + * + * If a routing table contains multiple routes with the same `zone` and `destination`, the route with the highest + * priority (smallest value) is selected. If two routes have the same `destination` and `priority`, traffic is + * distributed between them. + * + * @return the priority + */ + public Long getPriority() { + return priority; + } + + /** + * Gets the zone. + * + * The zone the route applies to. (Traffic from subnets in this zone will be + * subject to this route.). + * + * @return the zone + */ + public ZoneReference getZone() { + return zone; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMember.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMember.java index 41d19cb151..7ef4d14411 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMember.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMember.java @@ -45,7 +45,7 @@ public interface Status { } @SerializedName("private_ip") - protected IP privateIp; + protected ReservedIPReference privateIp; @SerializedName("public_ip") protected IP publicIp; protected String role; @@ -56,13 +56,13 @@ protected VPNGatewayMember() { } /** * Gets the privateIp. * - * The private IP address assigned to the VPN gateway member. + * The reserved IP address assigned to the VPN gateway member. * * This property will be present only when the VPN gateway status is `available`. * * @return the privateIp */ - public IP getPrivateIp() { + public ReservedIPReference getPrivateIp() { return privateIp; } 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 96175bdf85..f395ba3d5c 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 @@ -68,6 +68,14 @@ public interface HealthState { String OK = "ok"; } + /** + * The resource type. + */ + public interface ResourceType { + /** volume. */ + String VOLUME = "volume"; + } + /** * The status of the volume. * @@ -115,6 +123,8 @@ public interface Status { protected VolumeProfileReference profile; @SerializedName("resource_group") protected ResourceGroupReference resourceGroup; + @SerializedName("resource_type") + protected String resourceType; @SerializedName("source_image") protected ImageReference sourceImage; @SerializedName("source_snapshot") @@ -348,6 +358,17 @@ public ResourceGroupReference getResourceGroup() { return resourceGroup; } + /** + * Gets the resourceType. + * + * The resource type. + * + * @return the resourceType + */ + public String getResourceType() { + return resourceType; + } + /** * Gets the sourceImage. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceWrapper.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceWrapper.java index cdeaae33cc..ac020ce707 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceWrapper.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceWrapper.java @@ -12,6 +12,8 @@ public class VolumeAttachmentPrototypeInstanceWrapper extends GenericModel { protected Long iops; protected String name; protected VolumeProfileIdentity profile; + @SerializedName("resource_group") + protected ResourceGroupIdentity resourceGroup; @SerializedName("source_snapshot") protected SnapshotIdentity sourceSnapshot; @SerializedName("user_tags") 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 262030d5be..b453759cb4 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 @@ -32,6 +32,8 @@ public class VolumeAttachmentPrototypeVolume extends GenericModel { protected Long iops; protected String name; protected VolumeProfileIdentity profile; + @SerializedName("resource_group") + protected ResourceGroupIdentity resourceGroup; @SerializedName("user_tags") protected List userTags; protected Long capacity; @@ -111,6 +113,18 @@ public VolumeProfileIdentity profile() { return profile; } + /** + * Gets the resourceGroup. + * + * The resource group to use for this volume. If unspecified, the instance's resource group + * will be used. + * + * @return the resourceGroup + */ + public ResourceGroupIdentity resourceGroup() { + return resourceGroup; + } + /** * Gets the userTags. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java index 1e14f63b5f..86add8d755 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.java @@ -28,6 +28,7 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private ResourceGroupIdentity resourceGroup; private List userTags; private Long capacity; private EncryptionKeyIdentity encryptionKey; @@ -41,6 +42,7 @@ public Builder(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext vol this.iops = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.iops; this.name = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.name; this.profile = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.profile; + this.resourceGroup = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.resourceGroup; this.userTags = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.userTags; this.capacity = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.capacity; this.encryptionKey = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.encryptionKey; @@ -121,6 +123,17 @@ public Builder profile(VolumeProfileIdentity profile) { return this; } + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + /** * Set the userTags. * Existing userTags will be replaced. @@ -166,6 +179,7 @@ protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePro iops = builder.iops; name = builder.name; profile = builder.profile; + resourceGroup = builder.resourceGroup; userTags = builder.userTags; capacity = builder.capacity; encryptionKey = builder.encryptionKey; 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 dab8f344db..25e7b4302e 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 @@ -28,6 +28,7 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private ResourceGroupIdentity resourceGroup; private List userTags; private Long capacity; private EncryptionKeyIdentity encryptionKey; @@ -42,6 +43,7 @@ public Builder(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext vol this.iops = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.iops; this.name = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.name; this.profile = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.profile; + this.resourceGroup = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.resourceGroup; this.userTags = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.userTags; this.capacity = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.capacity; this.encryptionKey = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.encryptionKey; @@ -123,6 +125,17 @@ public Builder profile(VolumeProfileIdentity profile) { return this; } + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + /** * Set the userTags. * Existing userTags will be replaced. @@ -179,6 +192,7 @@ protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePro iops = builder.iops; name = builder.name; profile = builder.profile; + resourceGroup = builder.resourceGroup; userTags = builder.userTags; capacity = builder.capacity; encryptionKey = builder.encryptionKey; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollection.java index ae7b739bc1..0d3b347bce 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollection.java @@ -14,6 +14,7 @@ import java.util.List; +import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; /** @@ -24,6 +25,8 @@ public class VolumeCollection extends GenericModel { protected VolumeCollectionFirst first; protected Long limit; protected VolumeCollectionNext next; + @SerializedName("total_count") + protected Long totalCount; protected List volumes; protected VolumeCollection() { } @@ -62,6 +65,17 @@ public VolumeCollectionNext getNext() { return next; } + /** + * Gets the totalCount. + * + * The total number of resources across all pages. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } + /** * Gets the volumes. * 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 cd6848ba0c..e150cc41f7 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 @@ -29,6 +29,7 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private ResourceGroupIdentity resourceGroup; private List userTags; /** @@ -42,6 +43,7 @@ private Builder(VolumePrototypeInstanceByImageContext volumePrototypeInstanceByI this.iops = volumePrototypeInstanceByImageContext.iops; this.name = volumePrototypeInstanceByImageContext.name; this.profile = volumePrototypeInstanceByImageContext.profile; + this.resourceGroup = volumePrototypeInstanceByImageContext.resourceGroup; this.userTags = volumePrototypeInstanceByImageContext.userTags; } @@ -140,6 +142,17 @@ public Builder profile(VolumeProfileIdentity profile) { return this; } + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the VolumePrototypeInstanceByImageContext builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + /** * Set the userTags. * Existing userTags will be replaced. @@ -163,6 +176,7 @@ protected VolumePrototypeInstanceByImageContext(Builder builder) { iops = builder.iops; name = builder.name; profile = builder.profile; + resourceGroup = builder.resourceGroup; userTags = builder.userTags; } @@ -238,6 +252,18 @@ public VolumeProfileIdentity profile() { return profile; } + /** + * Gets the resourceGroup. + * + * The resource group to use for this volume. If unspecified, the instance's resource group + * will be used. + * + * @return the resourceGroup + */ + public ResourceGroupIdentity resourceGroup() { + return resourceGroup; + } + /** * Gets the userTags. * 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 065b445eba..ff473ae982 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 @@ -15,7 +15,6 @@ import java.util.ArrayList; import java.util.List; - /** * VolumePrototypeInstanceBySourceSnapshotContext. */ @@ -30,6 +29,7 @@ public static class Builder { private Long iops; private String name; private VolumeProfileIdentity profile; + private ResourceGroupIdentity resourceGroup; private SnapshotIdentity sourceSnapshot; private List userTags; @@ -44,6 +44,7 @@ private Builder(VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeIn this.iops = volumePrototypeInstanceBySourceSnapshotContext.iops; this.name = volumePrototypeInstanceBySourceSnapshotContext.name; this.profile = volumePrototypeInstanceBySourceSnapshotContext.profile; + this.resourceGroup = volumePrototypeInstanceBySourceSnapshotContext.resourceGroup; this.sourceSnapshot = volumePrototypeInstanceBySourceSnapshotContext.sourceSnapshot; this.userTags = volumePrototypeInstanceBySourceSnapshotContext.userTags; } @@ -145,6 +146,17 @@ public Builder profile(VolumeProfileIdentity profile) { return this; } + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the VolumePrototypeInstanceBySourceSnapshotContext builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + /** * Set the sourceSnapshot. * @@ -181,6 +193,7 @@ protected VolumePrototypeInstanceBySourceSnapshotContext(Builder builder) { iops = builder.iops; name = builder.name; profile = builder.profile; + resourceGroup = builder.resourceGroup; sourceSnapshot = builder.sourceSnapshot; userTags = builder.userTags; } @@ -257,6 +270,18 @@ public VolumeProfileIdentity profile() { return profile; } + /** + * Gets the resourceGroup. + * + * The resource group to use for this volume. If unspecified, the instance's resource group + * will be used. + * + * @return the resourceGroup + */ + public ResourceGroupIdentity resourceGroup() { + return resourceGroup; + } + /** * Gets the sourceSnapshot. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroup.java new file mode 100644 index 0000000000..1e74a9dde0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroup.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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 resource group to use. If unspecified, the account's [default resource + * group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + * + * Classes which extend this class: + * - VolumePrototypeResourceGroupResourceGroupIdentityById + */ +public class VolumePrototypeResourceGroup extends GenericModel { + + protected String id; + + protected VolumePrototypeResourceGroup() { } + + /** + * Gets the id. + * + * The unique identifier for this resource group. + * + * @return the id + */ + public String id() { + return id; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupResourceGroupIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupResourceGroupIdentityById.java new file mode 100644 index 0000000000..03e18572ea --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupResourceGroupIdentityById.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * VolumePrototypeResourceGroupResourceGroupIdentityById. + */ +public class VolumePrototypeResourceGroupResourceGroupIdentityById extends VolumePrototypeResourceGroup { + + + /** + * Builder. + */ + public static class Builder { + private String id; + + /** + * Instantiates a new Builder from an existing VolumePrototypeResourceGroupResourceGroupIdentityById instance. + * + * @param volumePrototypeResourceGroupResourceGroupIdentityById the instance to initialize the Builder with + */ + public Builder(VolumePrototypeResourceGroup volumePrototypeResourceGroupResourceGroupIdentityById) { + this.id = volumePrototypeResourceGroupResourceGroupIdentityById.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 VolumePrototypeResourceGroupResourceGroupIdentityById. + * + * @return the new VolumePrototypeResourceGroupResourceGroupIdentityById instance + */ + public VolumePrototypeResourceGroupResourceGroupIdentityById build() { + return new VolumePrototypeResourceGroupResourceGroupIdentityById(this); + } + + /** + * Set the id. + * + * @param id the id + * @return the VolumePrototypeResourceGroupResourceGroupIdentityById builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + } + + protected VolumePrototypeResourceGroupResourceGroupIdentityById() { } + + protected VolumePrototypeResourceGroupResourceGroupIdentityById(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, + "id cannot be null"); + id = builder.id; + } + + /** + * New builder. + * + * @return a VolumePrototypeResourceGroupResourceGroupIdentityById builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReference.java index 930071c387..2227565f6d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReference.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReference.java @@ -12,6 +12,7 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; /** @@ -19,11 +20,22 @@ */ public class VolumeReference extends GenericModel { + /** + * The resource type. + */ + public interface ResourceType { + /** volume. */ + String VOLUME = "volume"; + } + protected String crn; protected VolumeReferenceDeleted deleted; protected String href; protected String id; protected String name; + protected VolumeRemote remote; + @SerializedName("resource_type") + protected String resourceType; protected VolumeReference() { } @@ -82,5 +94,28 @@ public String getId() { public String getName() { return name; } + + /** + * Gets the remote. + * + * If present, this property indicates that the resource associated with this reference + * is remote and therefore may not be directly retrievable. + * + * @return the remote + */ + public VolumeRemote getRemote() { + return remote; + } + + /** + * 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/VolumeReferenceVolumeAttachmentContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceVolumeAttachmentContext.java index fef7d4a0cd..f09af158eb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceVolumeAttachmentContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceVolumeAttachmentContext.java @@ -12,6 +12,7 @@ */ package com.ibm.cloud.is.vpc.v1.model; +import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; /** @@ -19,11 +20,21 @@ */ public class VolumeReferenceVolumeAttachmentContext extends GenericModel { + /** + * The resource type. + */ + public interface ResourceType { + /** volume. */ + String VOLUME = "volume"; + } + protected String crn; protected VolumeReferenceVolumeAttachmentContextDeleted deleted; protected String href; protected String id; protected String name; + @SerializedName("resource_type") + protected String resourceType; protected VolumeReferenceVolumeAttachmentContext() { } @@ -82,5 +93,16 @@ public String getId() { public String getName() { return name; } + + /** + * 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/VolumeRemote.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeRemote.java new file mode 100644 index 0000000000..f4a875dd80 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeRemote.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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; + +/** + * If present, this property indicates that the resource associated with this reference is remote and therefore may not + * be directly retrievable. + */ +public class VolumeRemote extends GenericModel { + + protected RegionReference region; + + protected VolumeRemote() { } + + /** + * Gets the region. + * + * If present, this property indicates that the referenced resource is remote to this + * region, and identifies the native region. + * + * @return the region + */ + public RegionReference getRegion() { + return region; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutesPager.java index 6f3e2c1ad7..22d645ef01 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutesPager.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpcRoutesPager.java @@ -66,9 +66,9 @@ public boolean hasNext() { /** * Returns the next page of results. - * @return a List<Route> that contains the next page of results + * @return a List<RouteCollectionVPCContextRoutesItem> that contains the next page of results */ - public List getNext() { + public List getNext() { if (!hasNext()) { throw new NoSuchElementException("No more results available"); } @@ -79,7 +79,7 @@ public List getNext() { } this.options = builder.build(); - RouteCollection result = client.listVpcRoutes(options).execute().getResult(); + RouteCollectionVPCContext result = client.listVpcRoutes(options).execute().getResult(); String next = null; if (result.getNext() != null) { @@ -98,12 +98,12 @@ public List getNext() { /** * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. - * @return a List<Route> containing all results returned by the "listVpcRoutes" method + * @return a List<RouteCollectionVPCContextRoutesItem> containing all results returned by the "listVpcRoutes" method */ - public List getAll() { - List results = new ArrayList<>(); + public List getAll() { + List results = new ArrayList<>(); while (hasNext()) { - List nextPage = getNext(); + 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 a08c507158..8fb290a85d 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 @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1; import com.ibm.cloud.is.test.SdkIntegrationTestBase; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.AddBareMetalServerNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddEndpointGatewayIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddInstanceNetworkInterfaceFloatingIpOptions; @@ -50,6 +51,9 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanPrototype; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicy; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicyPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServer; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerBootTarget; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerBootTargetBareMetalServerDiskReference; @@ -323,6 +327,7 @@ import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerClientOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerRouteOptions; +import com.ibm.cloud.is.vpc.v1.model.DeprecateImageOptions; import com.ibm.cloud.is.vpc.v1.model.DisconnectVpnClientOptions; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentity; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; @@ -515,6 +520,7 @@ import com.ibm.cloud.is.vpc.v1.model.ImagePrototypeImageBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.ImageStatusReason; import com.ibm.cloud.is.vpc.v1.model.ImagesPager; import com.ibm.cloud.is.vpc.v1.model.Instance; @@ -718,15 +724,15 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityById; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImageInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImage; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePatch; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototype; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceTemplate; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImage; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot; +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.InstanceTemplateReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; @@ -917,6 +923,9 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileIdentity; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileInstanceGroupsSupported; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileInstanceGroupsSupportedDependent; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileInstanceGroupsSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileLoggingSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileReference; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileRouteModeSupported; @@ -991,6 +1000,7 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceReferenceTargetContextDeleted; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceUnpaginatedCollection; +import com.ibm.cloud.is.vpc.v1.model.ObsoleteImageOptions; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemCollection; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemCollectionFirst; @@ -1028,6 +1038,9 @@ import com.ibm.cloud.is.vpc.v1.model.PublicGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.Region; import com.ibm.cloud.is.vpc.v1.model.RegionCollection; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentity; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByHref; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByName; import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.RemoveBareMetalServerNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveEndpointGatewayIpOptions; @@ -1071,6 +1084,10 @@ import com.ibm.cloud.is.vpc.v1.model.RouteCollection; import com.ibm.cloud.is.vpc.v1.model.RouteCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.RouteCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContext; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextFirst; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextNext; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextRoutesItem; import com.ibm.cloud.is.vpc.v1.model.RouteCreator; import com.ibm.cloud.is.vpc.v1.model.RouteCreatorVPNGatewayReference; import com.ibm.cloud.is.vpc.v1.model.RouteCreatorVPNServerReference; @@ -1162,15 +1179,19 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotCollection; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.SnapshotCopiesItem; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentity; 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.SnapshotPatch; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototype; +import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; +import com.ibm.cloud.is.vpc.v1.model.SnapshotSourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.SnapshotsPager; import com.ibm.cloud.is.vpc.v1.model.StartBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.StopBareMetalServerOptions; @@ -1375,6 +1396,7 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceVolumeAttachmentContext; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceVolumeAttachmentContextDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; import com.ibm.cloud.is.vpc.v1.model.VolumeStatusReason; import com.ibm.cloud.is.vpc.v1.model.VolumesPager; import com.ibm.cloud.is.vpc.v1.model.VpcAddressPrefixesPager; @@ -1794,20 +1816,20 @@ public void testListVpcRoutes() throws Exception { try { ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() .vpcId("testString") - .zoneName("testString") + .zoneName("us-south-1") .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listVpcRoutes(listVpcRoutesOptions).execute(); + Response response = service.listVpcRoutes(listVpcRoutesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - RouteCollection routeCollectionResult = response.getResult(); + RouteCollectionVPCContext routeCollectionVpcContextResult = response.getResult(); - assertNotNull(routeCollectionResult); + assertNotNull(routeCollectionVpcContextResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); @@ -1819,15 +1841,15 @@ public void testListVpcRoutesWithPager() throws Exception { try { ListVpcRoutesOptions options = new ListVpcRoutesOptions.Builder() .vpcId("testString") - .zoneName("testString") + .zoneName("us-south-1") .limit(Long.valueOf("10")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); + 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); } @@ -1835,7 +1857,7 @@ public void testListVpcRoutesWithPager() throws Exception { // Test getAll(); pager = new VpcRoutesPager(service, options); - List allItems = pager.getAll(); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -2274,7 +2296,7 @@ public void testListSubnets() throws Exception { .limit(Long.valueOf("10")) .resourceGroupId("testString") .routingTableId("testString") - .routingTableName("testString") + .routingTableName("my-routing-table") .build(); // Invoke operation @@ -2299,7 +2321,7 @@ public void testListSubnetsWithPager() throws Exception { .limit(Long.valueOf("10")) .resourceGroupId("testString") .routingTableId("testString") - .routingTableName("testString") + .routingTableName("my-routing-table") .build(); // Test getNext(). @@ -2745,6 +2767,7 @@ public void testListImages() throws Exception { .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") + .status(java.util.Arrays.asList("available")) .visibility("private") .build(); @@ -2770,6 +2793,7 @@ public void testListImagesWithPager() throws Exception { .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") + .status(java.util.Arrays.asList("available")) .visibility("private") .build(); @@ -2817,7 +2841,9 @@ public void testCreateImage() throws Exception { .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) @@ -2870,7 +2896,9 @@ public void testGetImage() throws Exception { public void testUpdateImage() 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")) .build(); Map imagePatchModelAsPatch = imagePatchModel.asPatch(); @@ -2895,6 +2923,42 @@ public void testUpdateImage() throws Exception { } @Test(dependsOnMethods = { "testUpdateImage" }) + public void testDeprecateImage() throws Exception { + try { + DeprecateImageOptions deprecateImageOptions = new DeprecateImageOptions.Builder() + .id("testString") + .build(); + + // Invoke operation + Response response = service.deprecateImage(deprecateImageOptions).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 = { "testDeprecateImage" }) + public void testObsoleteImage() throws Exception { + try { + ObsoleteImageOptions obsoleteImageOptions = new ObsoleteImageOptions.Builder() + .id("testString") + .build(); + + // 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 { try { ListImageExportJobsOptions listImageExportJobsOptions = new ListImageExportJobsOptions.Builder() @@ -3335,6 +3399,7 @@ public void testCreateInstanceTemplate() throws Exception { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); @@ -3374,7 +3439,7 @@ public void testCreateInstanceTemplate() throws Exception { .name("us-south-1") .build(); - InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.Builder() + InstanceTemplatePrototypeInstanceTemplateByImage instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceTemplateByImage.Builder() .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) .keys(java.util.Arrays.asList(keyIdentityModel)) @@ -3472,14 +3537,14 @@ public void testListInstances() throws Exception { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .dedicatedHostId("testString") - .dedicatedHostCrn("testString") - .dedicatedHostName("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") .placementGroupId("testString") - .placementGroupCrn("testString") - .placementGroupName("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") .build(); // Invoke operation @@ -3505,14 +3570,14 @@ public void testListInstancesWithPager() throws Exception { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .dedicatedHostId("testString") - .dedicatedHostCrn("testString") - .dedicatedHostName("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") .placementGroupId("testString") - .placementGroupCrn("testString") - .placementGroupName("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") .build(); // Test getNext(). @@ -3589,6 +3654,7 @@ public void testCreateInstance() throws Exception { .iops(Long.valueOf("10000")) .name("my-data-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("1000")) .encryptionKey(encryptionKeyIdentityModel) @@ -3610,6 +3676,7 @@ public void testCreateInstance() throws Exception { .iops(Long.valueOf("10000")) .name("my-boot-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); @@ -5018,7 +5085,7 @@ public void testListDedicatedHostGroups() throws Exception { .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -5043,7 +5110,7 @@ public void testListDedicatedHostGroupsWithPager() throws Exception { ListDedicatedHostGroupsOptions options = new ListDedicatedHostGroupsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -5239,7 +5306,7 @@ public void testListDedicatedHosts() throws Exception { .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -5265,7 +5332,7 @@ public void testListDedicatedHostsWithPager() throws Exception { .dedicatedHostGroupId("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -5537,6 +5604,20 @@ public void testCreateBackupPolicy() throws Exception { .deleteOverCount(Long.valueOf("20")) .build(); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() .active(true) .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) @@ -5545,6 +5626,7 @@ public void testCreateBackupPolicy() throws Exception { .cronSpec("30 */2 * * 1-5") .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() @@ -5579,14 +5661,14 @@ public void testListBackupPolicyJobs() throws Exception { try { ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() .backupPolicyId("testString") - .status("testString") + .status("failed") .backupPolicyPlanId("testString") .start("testString") .limit(Long.valueOf("10")) .sort("name") .sourceId("testString") .targetSnapshotsId("testString") - .targetSnapshotsCrn("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); // Invoke operation @@ -5609,13 +5691,13 @@ public void testListBackupPolicyJobsWithPager() throws Exception { try { ListBackupPolicyJobsOptions options = new ListBackupPolicyJobsOptions.Builder() .backupPolicyId("testString") - .status("testString") + .status("failed") .backupPolicyPlanId("testString") .limit(Long.valueOf("10")) .sort("name") .sourceId("testString") .targetSnapshotsId("testString") - .targetSnapshotsCrn("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); // Test getNext(). @@ -5705,6 +5787,20 @@ public void testCreateBackupPolicyPlan() throws Exception { .deleteOverCount(Long.valueOf("20")) .build(); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions = new CreateBackupPolicyPlanOptions.Builder() .backupPolicyId("testString") .cronSpec("30 */2 * * 1-5") @@ -5714,6 +5810,7 @@ public void testCreateBackupPolicyPlan() throws Exception { .copyUserTags(true) .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); // Invoke operation @@ -5771,6 +5868,20 @@ public void testUpdateBackupPolicyPlan() throws Exception { .deleteOverCount(Long.valueOf("1")) .build(); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() .active(true) .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) @@ -5779,6 +5890,7 @@ public void testUpdateBackupPolicyPlan() throws Exception { .cronSpec("30 */2 * * 1-5") .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); Map backupPolicyPlanPatchModelAsPatch = backupPolicyPlanPatchModel.asPatch(); @@ -6073,11 +6185,11 @@ public void testListBareMetalServers() throws Exception { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .networkInterfacesSubnetId("testString") - .networkInterfacesSubnetCrn("testString") - .networkInterfacesSubnetName("testString") + .networkInterfacesSubnetCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .networkInterfacesSubnetName("my-subnet") .build(); // Invoke operation @@ -6103,11 +6215,11 @@ public void testListBareMetalServersWithPager() throws Exception { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .networkInterfacesSubnetId("testString") - .networkInterfacesSubnetCrn("testString") - .networkInterfacesSubnetName("testString") + .networkInterfacesSubnetCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .networkInterfacesSubnetName("my-subnet") .build(); // Test getNext(). @@ -6828,7 +6940,7 @@ public void testListVolumes() throws Exception { .encryption("provider_managed") .operatingSystemFamily("Ubuntu Server") .operatingSystemArchitecture("amd64") - .zoneName("testString") + .zoneName("us-south-1") .build(); // Invoke operation @@ -6856,7 +6968,7 @@ public void testListVolumesWithPager() throws Exception { .encryption("provider_managed") .operatingSystemFamily("Ubuntu Server") .operatingSystemArchitecture("amd64") - .zoneName("testString") + .zoneName("us-south-1") .build(); // Test getNext(). @@ -7001,12 +7113,20 @@ public void testListSnapshots() throws Exception { .resourceGroupId("testString") .name("testString") .sourceVolumeId("testString") - .sourceVolumeCrn("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .sourceImageId("testString") - .sourceImageCrn("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .sort("name") .backupPolicyPlanId("testString") - .clonesZoneName("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("testString") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-south") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") .build(); // Invoke operation @@ -7033,12 +7153,20 @@ public void testListSnapshotsWithPager() throws Exception { .resourceGroupId("testString") .name("testString") .sourceVolumeId("testString") - .sourceVolumeCrn("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .sourceImageId("testString") - .sourceImageCrn("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .sort("name") .backupPolicyPlanId("testString") - .clonesZoneName("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("testString") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-south") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") .build(); // Test getNext(). @@ -7948,8 +8076,8 @@ public void testListSecurityGroups() throws Exception { .limit(Long.valueOf("10")) .resourceGroupId("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); // Invoke operation @@ -7974,8 +8102,8 @@ public void testListSecurityGroupsWithPager() throws Exception { .limit(Long.valueOf("10")) .resourceGroupId("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); // Test getNext(). @@ -8378,7 +8506,7 @@ public void testCreateIkePolicy() throws Exception { .build(); CreateIkePolicyOptions createIkePolicyOptions = new CreateIkePolicyOptions.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("sha256") .dhGroup(Long.valueOf("14")) .encryptionAlgorithm("aes128") .ikeVersion(Long.valueOf("1")) @@ -8428,7 +8556,7 @@ public void testGetIkePolicy() throws Exception { public void testUpdateIkePolicy() throws Exception { try { IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("sha256") .dhGroup(Long.valueOf("14")) .encryptionAlgorithm("aes128") .ikeVersion(Long.valueOf("1")) @@ -8792,7 +8920,7 @@ public void testListVpnGatewayConnections() throws Exception { try { ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions = new ListVpnGatewayConnectionsOptions.Builder() .vpnGatewayId("testString") - .status("testString") + .status("down") .build(); // Invoke operation @@ -10853,10 +10981,10 @@ public void testListFlowLogCollectors() throws Exception { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .targetId("testString") - .targetResourceType("instance") + .targetResourceType("testString") .build(); // Invoke operation @@ -10882,10 +11010,10 @@ public void testListFlowLogCollectorsWithPager() throws Exception { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .targetId("testString") - .targetResourceType("instance") + .targetResourceType("testString") .build(); // Test getNext(). 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 f8735c1017..5c56e69453 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 @@ -13,6 +13,7 @@ package com.ibm.cloud.is.vpc.v1; import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.AddBareMetalServerNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddEndpointGatewayIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddInstanceNetworkInterfaceFloatingIpOptions; @@ -49,6 +50,9 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanPrototype; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicy; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicyPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServer; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerBootTarget; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerBootTargetBareMetalServerDiskReference; @@ -322,6 +326,7 @@ import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerClientOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteVpnServerRouteOptions; +import com.ibm.cloud.is.vpc.v1.model.DeprecateImageOptions; import com.ibm.cloud.is.vpc.v1.model.DisconnectVpnClientOptions; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentity; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; @@ -514,6 +519,7 @@ import com.ibm.cloud.is.vpc.v1.model.ImagePrototypeImageBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.ImageStatusReason; import com.ibm.cloud.is.vpc.v1.model.ImagesPager; import com.ibm.cloud.is.vpc.v1.model.Instance; @@ -717,15 +723,15 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityById; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImageInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImage; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePatch; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototype; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceTemplate; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImage; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot; +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.InstanceTemplateReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; @@ -916,6 +922,9 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileIdentity; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileIdentityByName; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileInstanceGroupsSupported; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileInstanceGroupsSupportedDependent; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileInstanceGroupsSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileLoggingSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileReference; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileRouteModeSupported; @@ -990,6 +999,7 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceReferenceTargetContextDeleted; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceUnpaginatedCollection; +import com.ibm.cloud.is.vpc.v1.model.ObsoleteImageOptions; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemCollection; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemCollectionFirst; @@ -1027,6 +1037,9 @@ import com.ibm.cloud.is.vpc.v1.model.PublicGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.Region; import com.ibm.cloud.is.vpc.v1.model.RegionCollection; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentity; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByHref; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByName; import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.RemoveBareMetalServerNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveEndpointGatewayIpOptions; @@ -1070,6 +1083,10 @@ import com.ibm.cloud.is.vpc.v1.model.RouteCollection; import com.ibm.cloud.is.vpc.v1.model.RouteCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.RouteCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContext; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextFirst; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextNext; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextRoutesItem; import com.ibm.cloud.is.vpc.v1.model.RouteCreator; import com.ibm.cloud.is.vpc.v1.model.RouteCreatorVPNGatewayReference; import com.ibm.cloud.is.vpc.v1.model.RouteCreatorVPNServerReference; @@ -1161,15 +1178,19 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotCollection; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.SnapshotCopiesItem; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentity; 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.SnapshotPatch; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototype; +import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; +import com.ibm.cloud.is.vpc.v1.model.SnapshotSourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.SnapshotsPager; import com.ibm.cloud.is.vpc.v1.model.StartBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.StopBareMetalServerOptions; @@ -1374,6 +1395,7 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceVolumeAttachmentContext; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceVolumeAttachmentContextDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; import com.ibm.cloud.is.vpc.v1.model.VolumeStatusReason; import com.ibm.cloud.is.vpc.v1.model.VolumesPager; import com.ibm.cloud.is.vpc.v1.model.VpcAddressPrefixesPager; @@ -1397,6 +1419,7 @@ import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; +import com.ibm.cloud.sdk.core.util.RequestUtils; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -1421,7 +1444,7 @@ public class VpcTest { protected MockWebServer server; protected Vpc vpcService; - String version = "2022-09-13"; + String version = "2023-07-11"; // Construct the service with a null authenticator (negative test) @Test(expectedExceptions = IllegalArgumentException.class) @@ -1832,7 +1855,7 @@ public void testGetVpcDefaultNetworkAclNoOptions() throws Throwable { @Test public void testGetVpcDefaultRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"milled-easy-equine-machines\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"milled-easy-equine-machines\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; String getVpcDefaultRoutingTablePath = "/vpcs/testString/default_routing_table"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -2300,15 +2323,15 @@ public void testListVpcRoutesWOptions() throws Throwable { // Construct an instance of the ListVpcRoutesOptions model ListVpcRoutesOptions listVpcRoutesOptionsModel = new ListVpcRoutesOptions.Builder() .vpcId("testString") - .zoneName("testString") + .zoneName("us-south-1") .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke listVpcRoutes() with a valid options model and verify the result - Response response = vpcService.listVpcRoutes(listVpcRoutesOptionsModel).execute(); + Response response = vpcService.listVpcRoutes(listVpcRoutesOptionsModel).execute(); assertNotNull(response); - RouteCollection responseObj = response.getResult(); + RouteCollectionVPCContext responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -2323,7 +2346,7 @@ public void testListVpcRoutesWOptions() throws Throwable { assertNotNull(query); assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("zone.name"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } @@ -2366,14 +2389,14 @@ public void testListVpcRoutesWithPagerGetNext() throws Throwable { ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() .vpcId("testString") - .zoneName("testString") + .zoneName("us-south-1") .limit(Long.valueOf("10")) .build(); - List allResults = new ArrayList<>(); + 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); } @@ -2401,12 +2424,12 @@ public void testListVpcRoutesWithPagerGetAll() throws Throwable { ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() .vpcId("testString") - .zoneName("testString") + .zoneName("us-south-1") .limit(Long.valueOf("10")) .build(); VpcRoutesPager pager = new VpcRoutesPager(vpcService, listVpcRoutesOptions); - List allResults = pager.getAll(); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } @@ -2415,7 +2438,7 @@ public void testListVpcRoutesWithPagerGetAll() throws Throwable { @Test public void testCreateVpcRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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 mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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") @@ -2537,7 +2560,7 @@ public void testDeleteVpcRouteNoOptions() throws Throwable { @Test public void testGetVpcRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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 mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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") @@ -2591,7 +2614,7 @@ public void testGetVpcRouteNoOptions() throws Throwable { @Test public void testUpdateVpcRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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 mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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") @@ -2659,7 +2682,7 @@ public void testUpdateVpcRouteNoOptions() throws Throwable { @Test public void testListVpcRoutingTablesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"routing_tables\": [{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}], \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"routing_tables\": [{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -2718,8 +2741,8 @@ public void testListVpcRoutingTablesNoOptions() throws Throwable { @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_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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) @@ -2753,8 +2776,8 @@ public void testListVpcRoutingTablesWithPagerGetNext() throws Throwable { @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_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_gateway\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"name\":\"my-route-1\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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) @@ -2784,7 +2807,7 @@ public void testListVpcRoutingTablesWithPagerGetAll() throws Throwable { @Test public void testCreateVpcRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -2923,7 +2946,7 @@ public void testDeleteVpcRoutingTableNoOptions() throws Throwable { @Test public void testGetVpcRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -2977,7 +3000,7 @@ public void testGetVpcRoutingTableNoOptions() throws Throwable { @Test public void testUpdateVpcRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -3049,7 +3072,7 @@ public void testUpdateVpcRoutingTableNoOptions() throws Throwable { @Test public void testListVpcRoutingTableRoutesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20\"}, \"routes\": [{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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 mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20\"}, \"routes\": [{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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") @@ -3107,8 +3130,8 @@ public void testListVpcRoutingTableRoutesNoOptions() throws Throwable { @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\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"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\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"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 mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"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\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"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) @@ -3142,8 +3165,8 @@ public void testListVpcRoutingTableRoutesWithPagerGetNext() throws Throwable { @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\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"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\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"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 mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"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\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_state\":\"stable\",\"name\":\"my-route-1\",\"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) @@ -3173,7 +3196,7 @@ public void testListVpcRoutingTableRoutesWithPagerGetAll() throws Throwable { @Test public void testCreateVpcRoutingTableRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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 mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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") @@ -3297,7 +3320,7 @@ public void testDeleteVpcRoutingTableRouteNoOptions() throws Throwable { @Test public void testGetVpcRoutingTableRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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 mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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") @@ -3352,7 +3375,7 @@ public void testGetVpcRoutingTableRouteNoOptions() throws Throwable { @Test public void testUpdateVpcRoutingTableRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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 mockResponseBody = "{\"action\": \"delegate\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn: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/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_state\": \"stable\", \"name\": \"my-route-1\", \"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") @@ -3434,7 +3457,7 @@ public void testListSubnetsWOptions() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .routingTableId("testString") - .routingTableName("testString") + .routingTableName("my-routing-table") .build(); // Invoke listSubnets() with a valid options model and verify the result @@ -3459,7 +3482,7 @@ public void testListSubnetsWOptions() throws Throwable { assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("routing_table.id"), "testString"); - assertEquals(query.get("routing_table.name"), "testString"); + assertEquals(query.get("routing_table.name"), "my-routing-table"); } // Test the listSubnets operation with and without retries enabled @@ -3495,7 +3518,7 @@ public void testListSubnetsWithPagerGetNext() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .routingTableId("testString") - .routingTableName("testString") + .routingTableName("my-routing-table") .build(); List allResults = new ArrayList<>(); @@ -3531,7 +3554,7 @@ public void testListSubnetsWithPagerGetAll() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .routingTableId("testString") - .routingTableName("testString") + .routingTableName("my-routing-table") .build(); SubnetsPager pager = new SubnetsPager(vpcService, listSubnetsOptions); @@ -4099,7 +4122,7 @@ public void testSetSubnetPublicGatewayNoOptions() throws Throwable { @Test public void testGetSubnetRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -4152,7 +4175,7 @@ public void testGetSubnetRoutingTableNoOptions() throws Throwable { @Test public void testReplaceSubnetRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_gateway\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"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/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"name\": \"my-route-1\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -4567,7 +4590,7 @@ public void testUpdateSubnetReservedIpNoOptions() throws Throwable { @Test public void testListImagesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images?limit=20\"}, \"images\": [{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-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\"}], \"visibility\": \"private\"}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images?limit=20\"}, \"images\": [{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image: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/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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\"}], \"visibility\": \"private\"}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; String listImagesPath = "/images"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4580,6 +4603,7 @@ public void testListImagesWOptions() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") + .status(java.util.Arrays.asList("available")) .visibility("private") .build(); @@ -4605,6 +4629,7 @@ public void testListImagesWOptions() throws Throwable { assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); + assertEquals(query.get("status"), RequestUtils.join(java.util.Arrays.asList("available"), ",")); assertEquals(query.get("visibility"), "private"); } @@ -4622,8 +4647,8 @@ public void testListImagesWRetries() throws Throwable { @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/123456: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/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-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\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-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\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + 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/123456: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/123456::image: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/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image: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/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -4641,6 +4666,7 @@ public void testListImagesWithPagerGetNext() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") + .status(java.util.Arrays.asList("available")) .visibility("private") .build(); @@ -4658,8 +4684,8 @@ public void testListImagesWithPagerGetNext() throws Throwable { @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/123456: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/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-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\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-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\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + 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/123456: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/123456::image: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/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image: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/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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\"}],\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -4677,6 +4703,7 @@ public void testListImagesWithPagerGetAll() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("testString") + .status(java.util.Arrays.asList("available")) .visibility("private") .build(); @@ -4690,7 +4717,7 @@ public void testListImagesWithPagerGetAll() throws Throwable { @Test public void testCreateImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-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\"}], \"visibility\": \"private\"}"; + String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image: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/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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\"}], \"visibility\": \"private\"}"; String createImagePath = "/images"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4719,7 +4746,9 @@ public void testCreateImageWOptions() throws Throwable { // 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) @@ -4825,7 +4854,7 @@ public void testDeleteImageNoOptions() throws Throwable { @Test public void testGetImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-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\"}], \"visibility\": \"private\"}"; + String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image: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/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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\"}], \"visibility\": \"private\"}"; String getImagePath = "/images/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4878,7 +4907,7 @@ public void testGetImageNoOptions() throws Throwable { @Test public void testUpdateImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-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\"}], \"visibility\": \"private\"}"; + String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::image: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/dffc98a0f1f0f95f6613b3b752286b87: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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\"}], \"visibility\": \"private\"}"; String updateImagePath = "/images/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -4887,7 +4916,9 @@ public void testUpdateImageWOptions() throws Throwable { // 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(); @@ -4934,6 +4965,110 @@ public void testUpdateImageNoOptions() throws Throwable { vpcService.updateImage(null).execute(); } + // Test the deprecateImage operation with a valid options model parameter + @Test + public void testDeprecateImageWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deprecateImagePath = "/images/testString/deprecate"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); + + // Construct an instance of the DeprecateImageOptions model + DeprecateImageOptions deprecateImageOptionsModel = new DeprecateImageOptions.Builder() + .id("testString") + .build(); + + // Invoke deprecateImage() with a valid options model and verify the result + Response response = vpcService.deprecateImage(deprecateImageOptionsModel).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, deprecateImagePath); + // 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 deprecateImage operation with and without retries enabled + @Test + public void testDeprecateImageWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testDeprecateImageWOptions(); + + vpcService.disableRetries(); + testDeprecateImageWOptions(); + } + + // Test the deprecateImage operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeprecateImageNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.deprecateImage(null).execute(); + } + + // Test the obsoleteImage operation with a valid options model parameter + @Test + public void testObsoleteImageWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String obsoleteImagePath = "/images/testString/obsolete"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); + + // Construct an instance of the ObsoleteImageOptions model + ObsoleteImageOptions obsoleteImageOptionsModel = new ObsoleteImageOptions.Builder() + .id("testString") + .build(); + + // Invoke obsoleteImage() with a valid options model and verify the result + Response response = vpcService.obsoleteImage(obsoleteImageOptionsModel).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, obsoleteImagePath); + // 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 obsoleteImage operation with and without retries enabled + @Test + public void testObsoleteImageWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testObsoleteImageWOptions(); + + vpcService.disableRetries(); + testObsoleteImageWOptions(); + } + + // Test the obsoleteImage operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testObsoleteImageNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.obsoleteImage(null).execute(); + } + // Test the listImageExportJobs operation with a valid options model parameter @Test public void testListImageExportJobsWOptions() throws Throwable { @@ -5222,7 +5357,7 @@ public void testUpdateImageExportJobNoOptions() throws Throwable { @Test public void testListOperatingSystemsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"operating_systems\": [{\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}]}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"operating_systems\": [{\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}], \"total_count\": 132}"; String listOperatingSystemsPath = "/operating_systems"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5386,7 +5521,7 @@ public void testGetOperatingSystemNoOptions() throws Throwable { @Test public void testListKeysWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20\"}, \"keys\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"length\": 2048, \"name\": \"my-key\", \"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\": \"rsa\"}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20\"}, \"keys\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"length\": 2048, \"name\": \"my-key\", \"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\": \"https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; String listKeysPath = "/keys"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5435,8 +5570,8 @@ public void testListKeysWRetries() throws Throwable { @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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"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\":\"rsa\"}],\"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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"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\":\"rsa\"}],\"limit\":1}"; + 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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"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) @@ -5468,8 +5603,8 @@ public void testListKeysWithPagerGetNext() throws Throwable { @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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"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\":\"rsa\"}],\"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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"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\":\"rsa\"}],\"limit\":1}"; + 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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"id\":\"a6b1a881-2ce8-41a3-80fc-36316a73f803\",\"length\":2048,\"name\":\"my-key\",\"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) @@ -5497,7 +5632,7 @@ public void testListKeysWithPagerGetAll() throws Throwable { @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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"length\": 2048, \"name\": \"my-key\", \"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\": \"rsa\"}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"length\": 2048, \"name\": \"my-key\", \"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") @@ -5610,7 +5745,7 @@ public void testDeleteKeyNoOptions() throws Throwable { @Test public void testGetKeyWOptions() 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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"length\": 2048, \"name\": \"my-key\", \"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\": \"rsa\"}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"length\": 2048, \"name\": \"my-key\", \"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") @@ -5663,7 +5798,7 @@ public void testGetKeyNoOptions() throws Throwable { @Test public void testUpdateKeyWOptions() 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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"length\": 2048, \"name\": \"my-key\", \"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\": \"rsa\"}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"length\": 2048, \"name\": \"my-key\", \"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") @@ -5820,7 +5955,7 @@ public void testGetInstanceProfileNoOptions() throws Throwable { @Test public void testListInstanceTemplatesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"templates\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"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\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"templates\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"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\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}], \"total_count\": 132}"; String listInstanceTemplatesPath = "/instance/templates"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5864,7 +5999,7 @@ public void testListInstanceTemplatesWRetries() throws Throwable { @Test public void testCreateInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"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\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"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\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; String createInstanceTemplatePath = "/instance/templates"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -5948,6 +6083,7 @@ public void testCreateInstanceTemplateWOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); @@ -5994,8 +6130,8 @@ public void testCreateInstanceTemplateWOptions() throws Throwable { .name("us-south-1") .build(); - // Construct an instance of the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext model - InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.Builder() + // Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImage model + InstanceTemplatePrototypeInstanceTemplateByImage instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceTemplateByImage.Builder() .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) .keys(java.util.Arrays.asList(keyIdentityModel)) @@ -6113,7 +6249,7 @@ public void testDeleteInstanceTemplateNoOptions() throws Throwable { @Test public void testGetInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"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\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"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\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; String getInstanceTemplatePath = "/instance/templates/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -6166,7 +6302,7 @@ public void testGetInstanceTemplateNoOptions() throws Throwable { @Test public void testUpdateInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"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\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"keys\": [{\"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"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\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}], \"primary_network_interface\": {\"allow_ip_spoofing\": true, \"name\": \"my-network-interface\", \"primary_ip\": {\"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"security_groups\": [{\"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}, \"zone\": {\"name\": \"us-south-1\"}}"; String updateInstanceTemplatePath = "/instance/templates/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -6226,7 +6362,7 @@ public void testUpdateInstanceTemplateNoOptions() throws Throwable { @Test public void testListInstancesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20\"}, \"instances\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-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\": 8, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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_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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"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\": \"https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20\"}, \"instances\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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\": 8, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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_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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"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\": \"https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; String listInstancesPath = "/instances"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -6240,14 +6376,14 @@ public void testListInstancesWOptions() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .dedicatedHostId("testString") - .dedicatedHostCrn("testString") - .dedicatedHostName("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") .placementGroupId("testString") - .placementGroupCrn("testString") - .placementGroupName("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") .build(); // Invoke listInstances() with a valid options model and verify the result @@ -6273,14 +6409,14 @@ public void testListInstancesWOptions() throws Throwable { assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "testString"); - assertEquals(query.get("vpc.name"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); assertEquals(query.get("dedicated_host.id"), "testString"); - assertEquals(query.get("dedicated_host.crn"), "testString"); - assertEquals(query.get("dedicated_host.name"), "testString"); + assertEquals(query.get("dedicated_host.crn"), "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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"), "testString"); - assertEquals(query.get("placement_group.name"), "testString"); + assertEquals(query.get("placement_group.crn"), "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871"); + assertEquals(query.get("placement_group.name"), "my-placement-group"); } // Test the listInstances operation with and without retries enabled @@ -6297,8 +6433,8 @@ public void testListInstancesWRetries() throws Throwable { @Test public void testListInstancesWithPagerGetNext() 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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-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\":8,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-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\":8,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"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\"},\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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\":8,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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\":8,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"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) @@ -6317,14 +6453,14 @@ public void testListInstancesWithPagerGetNext() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .dedicatedHostId("testString") - .dedicatedHostCrn("testString") - .dedicatedHostName("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") .placementGroupId("testString") - .placementGroupCrn("testString") - .placementGroupName("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") .build(); List allResults = new ArrayList<>(); @@ -6341,8 +6477,8 @@ public void testListInstancesWithPagerGetNext() throws Throwable { @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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-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\":8,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-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\":8,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"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\"},\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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\":8,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}],\"gpu\":{\"count\":1,\"manufacturer\":\"nvidia\",\"memory\":1,\"model\":\"Tesla V100\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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\":8,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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_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\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"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) @@ -6361,14 +6497,14 @@ public void testListInstancesWithPagerGetAll() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .dedicatedHostId("testString") - .dedicatedHostCrn("testString") - .dedicatedHostName("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") .placementGroupId("testString") - .placementGroupCrn("testString") - .placementGroupName("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") .build(); InstancesPager pager = new InstancesPager(vpcService, listInstancesOptions); @@ -6381,7 +6517,7 @@ public void testListInstancesWithPagerGetAll() throws Throwable { @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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-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\": 8, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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_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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"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 mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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\": 8, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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_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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"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") @@ -6446,6 +6582,7 @@ public void testCreateInstanceWOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-data-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("1000")) .encryptionKey(encryptionKeyIdentityModel) @@ -6470,6 +6607,7 @@ public void testCreateInstanceWOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-boot-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); @@ -6635,7 +6773,7 @@ public void testDeleteInstanceNoOptions() throws Throwable { @Test public void testGetInstanceWOptions() 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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-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\": 8, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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_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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"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 mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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\": 8, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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_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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"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") @@ -6688,7 +6826,7 @@ public void testGetInstanceNoOptions() throws Throwable { @Test public void testUpdateInstanceWOptions() 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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-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\": 8, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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_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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"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 mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456: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/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host: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/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"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/1e09281b-f177-46fb-baf1-bc152b2e391a/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}], \"gpu\": {\"count\": 1, \"manufacturer\": \"nvidia\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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\": 8, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group: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/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"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/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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_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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"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") @@ -7800,7 +7938,7 @@ public void testGetInstanceNetworkInterfaceIpNoOptions() throws Throwable { @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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}]}"; + String mockResponseBody = "{\"volume_attachments\": [{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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") @@ -7853,7 +7991,7 @@ public void testListInstanceVolumeAttachmentsNoOptions() throws Throwable { @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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}"; + String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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") @@ -7967,7 +8105,7 @@ public void testDeleteInstanceVolumeAttachmentNoOptions() throws Throwable { @Test public void testGetInstanceVolumeAttachmentWOptions() 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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}"; + String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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") @@ -8021,7 +8159,7 @@ public void testGetInstanceVolumeAttachmentNoOptions() throws Throwable { @Test public void testUpdateInstanceVolumeAttachmentWOptions() 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\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}}"; + String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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") @@ -9971,7 +10109,7 @@ public void testListDedicatedHostGroupsWOptions() throws Throwable { .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -9996,7 +10134,7 @@ public void testListDedicatedHostGroupsWOptions() throws Throwable { 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"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); assertEquals(query.get("name"), "testString"); } @@ -10032,7 +10170,7 @@ public void testListDedicatedHostGroupsWithPagerGetNext() throws Throwable { ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -10068,7 +10206,7 @@ public void testListDedicatedHostGroupsWithPagerGetAll() throws Throwable { ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -10491,7 +10629,7 @@ public void testListDedicatedHostsWOptions() throws Throwable { .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -10517,7 +10655,7 @@ public void testListDedicatedHostsWOptions() throws Throwable { 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"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); assertEquals(query.get("name"), "testString"); } @@ -10554,7 +10692,7 @@ public void testListDedicatedHostsWithPagerGetNext() throws Throwable { .dedicatedHostGroupId("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -10591,7 +10729,7 @@ public void testListDedicatedHostsWithPagerGetAll() throws Throwable { .dedicatedHostGroupId("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); @@ -11016,7 +11154,7 @@ public void testUpdateDedicatedHostNoOptions() throws Throwable { @Test public void testListBackupPoliciesWOptions() 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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"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\"}], \"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"backup_policies\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\"}], \"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; String listBackupPoliciesPath = "/backup_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -11071,8 +11209,8 @@ public void testListBackupPoliciesWRetries() throws Throwable { @Test public void testListBackupPoliciesWithPagerGetNext() 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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"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\"}],\"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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"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\"}],\"total_count\":2,\"limit\":1}"; + 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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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\"}],\"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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -11107,8 +11245,8 @@ public void testListBackupPoliciesWithPagerGetNext() throws Throwable { @Test public void testListBackupPoliciesWithPagerGetAll() 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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"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\"}],\"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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"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\"}],\"total_count\":2,\"limit\":1}"; + 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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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\"}],\"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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_resource_types\":[\"volume\"],\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -11139,7 +11277,7 @@ public void testListBackupPoliciesWithPagerGetAll() throws Throwable { @Test public void testCreateBackupPolicyWOptions() 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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"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\"}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\"}"; String createBackupPolicyPath = "/backup_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -11163,6 +11301,23 @@ public void testCreateBackupPolicyWOptions() throws Throwable { .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/dffc98a0f1f0f95f6613b3b752286b87: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("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + // Construct an instance of the BackupPolicyPlanPrototype model BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() .active(true) @@ -11172,6 +11327,7 @@ public void testCreateBackupPolicyWOptions() throws Throwable { .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 @@ -11229,7 +11385,7 @@ public void testCreateBackupPolicyNoOptions() throws Throwable { @Test public void testListBackupPolicyJobsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20\"}, \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\", \"id\": \"4cf9171a-0043-4434-8727-15b53dbc374c\", \"job_type\": \"creation\", \"resource_type\": \"backup_policy_job\", \"source\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"failed\", \"status_reasons\": [{\"code\": \"source_volume_busy\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc\"}], \"target_snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"resource_type\": \"snapshot\"}]}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobs?limit=20\"}, \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\", \"id\": \"4cf9171a-0043-4434-8727-15b53dbc374c\", \"job_type\": \"creation\", \"resource_type\": \"backup_policy_job\", \"source\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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-troubleshooting-backup-for-vpc\"}], \"target_snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}], \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/7241e2a8-601f-11ea-8503-000c29475bed/jobss?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132}"; String listBackupPolicyJobsPath = "/backup_policies/testString/jobs"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -11239,14 +11395,14 @@ public void testListBackupPolicyJobsWOptions() throws Throwable { // Construct an instance of the ListBackupPolicyJobsOptions model ListBackupPolicyJobsOptions listBackupPolicyJobsOptionsModel = new ListBackupPolicyJobsOptions.Builder() .backupPolicyId("testString") - .status("testString") + .status("failed") .backupPolicyPlanId("testString") .start("testString") .limit(Long.valueOf("10")) .sort("name") .sourceId("testString") .targetSnapshotsId("testString") - .targetSnapshotsCrn("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); // Invoke listBackupPolicyJobs() with a valid options model and verify the result @@ -11267,14 +11423,14 @@ public void testListBackupPolicyJobsWOptions() throws Throwable { assertNotNull(query); assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("status"), "testString"); + 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"), "testString"); + assertEquals(query.get("target_snapshots[].crn"), "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263"); } // Test the listBackupPolicyJobs operation with and without retries enabled @@ -11298,8 +11454,8 @@ public void testListBackupPolicyJobsNoOptions() throws Throwable { @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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\",\"id\":\"4cf9171a-0043-4434-8727-15b53dbc374c\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\",\"id\":\"4cf9171a-0043-4434-8727-15b53dbc374c\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\",\"id\":\"4cf9171a-0043-4434-8727-15b53dbc374c\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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-troubleshooting-backup-for-vpc\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\",\"id\":\"4cf9171a-0043-4434-8727-15b53dbc374c\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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-troubleshooting-backup-for-vpc\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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) @@ -11315,13 +11471,13 @@ public void testListBackupPolicyJobsWithPagerGetNext() throws Throwable { ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() .backupPolicyId("testString") - .status("testString") + .status("failed") .backupPolicyPlanId("testString") .limit(Long.valueOf("10")) .sort("name") .sourceId("testString") .targetSnapshotsId("testString") - .targetSnapshotsCrn("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); List allResults = new ArrayList<>(); @@ -11338,8 +11494,8 @@ public void testListBackupPolicyJobsWithPagerGetNext() throws Throwable { @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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\",\"id\":\"4cf9171a-0043-4434-8727-15b53dbc374c\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\",\"id\":\"4cf9171a-0043-4434-8727-15b53dbc374c\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\",\"id\":\"4cf9171a-0043-4434-8727-15b53dbc374c\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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-troubleshooting-backup-for-vpc\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\",\"id\":\"4cf9171a-0043-4434-8727-15b53dbc374c\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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-troubleshooting-backup-for-vpc\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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) @@ -11355,13 +11511,13 @@ public void testListBackupPolicyJobsWithPagerGetAll() throws Throwable { ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() .backupPolicyId("testString") - .status("testString") + .status("failed") .backupPolicyPlanId("testString") .limit(Long.valueOf("10")) .sort("name") .sourceId("testString") .targetSnapshotsId("testString") - .targetSnapshotsCrn("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); BackupPolicyJobsPager pager = new BackupPolicyJobsPager(vpcService, listBackupPolicyJobsOptions); @@ -11374,7 +11530,7 @@ public void testListBackupPolicyJobsWithPagerGetAll() throws Throwable { @Test public void testGetBackupPolicyJobWOptions() 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\", \"id\": \"4cf9171a-0043-4434-8727-15b53dbc374c\", \"job_type\": \"creation\", \"resource_type\": \"backup_policy_job\", \"source\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"status\": \"failed\", \"status_reasons\": [{\"code\": \"source_volume_busy\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-backup-for-vpc\"}], \"target_snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"resource_type\": \"snapshot\"}]}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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/0fe9e5d8-0a4d-4818-96ec-e99708644a58/jobs/4cf9171a-0043-4434-8727-15b53dbc374c\", \"id\": \"4cf9171a-0043-4434-8727-15b53dbc374c\", \"job_type\": \"creation\", \"resource_type\": \"backup_policy_job\", \"source\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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-troubleshooting-backup-for-vpc\"}], \"target_snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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") @@ -11428,7 +11584,7 @@ public void testGetBackupPolicyJobNoOptions() throws Throwable { @Test public void testListBackupPolicyPlansWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}]}"; + String mockResponseBody = "{\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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/dffc98a0f1f0f95f6613b3b752286b87: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 listBackupPolicyPlansPath = "/backup_policies/testString/plans"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -11483,7 +11639,7 @@ public void testListBackupPolicyPlansNoOptions() throws Throwable { @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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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/dffc98a0f1f0f95f6613b3b752286b87: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") @@ -11507,6 +11663,23 @@ public void testCreateBackupPolicyPlanWOptions() throws Throwable { .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/dffc98a0f1f0f95f6613b3b752286b87: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("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + // Construct an instance of the CreateBackupPolicyPlanOptions model CreateBackupPolicyPlanOptions createBackupPolicyPlanOptionsModel = new CreateBackupPolicyPlanOptions.Builder() .backupPolicyId("testString") @@ -11517,6 +11690,7 @@ public void testCreateBackupPolicyPlanWOptions() throws Throwable { .copyUserTags(true) .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); // Invoke createBackupPolicyPlan() with a valid options model and verify the result @@ -11560,7 +11734,7 @@ public void testCreateBackupPolicyPlanNoOptions() throws Throwable { @Test public void testDeleteBackupPolicyPlanWOptions() 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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/dffc98a0f1f0f95f6613b3b752286b87: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") @@ -11615,7 +11789,7 @@ public void testDeleteBackupPolicyPlanNoOptions() throws Throwable { @Test public void testGetBackupPolicyPlanWOptions() 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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/dffc98a0f1f0f95f6613b3b752286b87: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") @@ -11669,7 +11843,7 @@ public void testGetBackupPolicyPlanNoOptions() throws Throwable { @Test public void testUpdateBackupPolicyPlanWOptions() 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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/dffc98a0f1f0f95f6613b3b752286b87: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") @@ -11693,6 +11867,23 @@ public void testUpdateBackupPolicyPlanWOptions() throws Throwable { .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/dffc98a0f1f0f95f6613b3b752286b87: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("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + // Construct an instance of the BackupPolicyPlanPatch model BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() .active(true) @@ -11702,6 +11893,7 @@ public void testUpdateBackupPolicyPlanWOptions() throws Throwable { .cronSpec("30 */2 * * 1-5") .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); Map backupPolicyPlanPatchModelAsPatch = backupPolicyPlanPatchModel.asPatch(); @@ -11754,7 +11946,7 @@ public void testUpdateBackupPolicyPlanNoOptions() throws Throwable { @Test public void testDeleteBackupPolicyWOptions() 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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"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\"}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\"}"; String deleteBackupPolicyPath = "/backup_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -11808,7 +12000,7 @@ public void testDeleteBackupPolicyNoOptions() throws Throwable { @Test public void testGetBackupPolicyWOptions() 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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"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\"}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\"}"; String getBackupPolicyPath = "/backup_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -11861,7 +12053,7 @@ public void testGetBackupPolicyNoOptions() throws Throwable { @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/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"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\"}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::backup-policy:r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r134-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_resource_types\": [\"volume\"], \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\"}"; String updateBackupPolicyPath = "/backup_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -12437,11 +12629,11 @@ public void testListBareMetalServersWOptions() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .networkInterfacesSubnetId("testString") - .networkInterfacesSubnetCrn("testString") - .networkInterfacesSubnetName("testString") + .networkInterfacesSubnetCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .networkInterfacesSubnetName("my-subnet") .build(); // Invoke listBareMetalServers() with a valid options model and verify the result @@ -12467,11 +12659,11 @@ public void testListBareMetalServersWOptions() throws Throwable { assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "testString"); - assertEquals(query.get("vpc.name"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); assertEquals(query.get("network_interfaces.subnet.id"), "testString"); - assertEquals(query.get("network_interfaces.subnet.crn"), "testString"); - assertEquals(query.get("network_interfaces.subnet.name"), "testString"); + assertEquals(query.get("network_interfaces.subnet.crn"), "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); + assertEquals(query.get("network_interfaces.subnet.name"), "my-subnet"); } // Test the listBareMetalServers operation with and without retries enabled @@ -12508,11 +12700,11 @@ public void testListBareMetalServersWithPagerGetNext() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .networkInterfacesSubnetId("testString") - .networkInterfacesSubnetCrn("testString") - .networkInterfacesSubnetName("testString") + .networkInterfacesSubnetCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .networkInterfacesSubnetName("my-subnet") .build(); List allResults = new ArrayList<>(); @@ -12549,11 +12741,11 @@ public void testListBareMetalServersWithPagerGetAll() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .networkInterfacesSubnetId("testString") - .networkInterfacesSubnetCrn("testString") - .networkInterfacesSubnetName("testString") + .networkInterfacesSubnetCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .networkInterfacesSubnetName("my-subnet") .build(); BareMetalServersPager pager = new BareMetalServersPager(vpcService, listBareMetalServersOptions); @@ -13806,7 +13998,7 @@ public void testUpdateBareMetalServerNoOptions() throws Throwable { @Test public void testGetBareMetalServerInitializationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"keys\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"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/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"name\": \"my-key\"}], \"user_accounts\": [{\"encrypted_password\": \"VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"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/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"name\": \"my-key\"}, \"resource_type\": \"host_user_account\", \"username\": \"Administrator\"}]}"; + String mockResponseBody = "{\"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"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/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"name\": \"my-key\"}], \"user_accounts\": [{\"encrypted_password\": \"VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"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/a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"id\": \"a6b1a881-2ce8-41a3-80fc-36316a73f803\", \"name\": \"my-key\"}, \"resource_type\": \"host_user_account\", \"username\": \"Administrator\"}]}"; String getBareMetalServerInitializationPath = "/bare_metal_servers/testString/initialization"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -14180,7 +14372,7 @@ public void testGetVolumeProfileNoOptions() throws Throwable { @Test public void testListVolumesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"volumes\": [{\"active\": true, \"attachment_state\": \"attached\", \"bandwidth\": 1000, \"busy\": true, \"capacity\": 1000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"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\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"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\"}], \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"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 mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"total_count\": 132, \"volumes\": [{\"active\": true, \"attachment_state\": \"attached\", \"bandwidth\": 1000, \"busy\": true, \"capacity\": 1000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"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/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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\"}], \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"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") @@ -14196,7 +14388,7 @@ public void testListVolumesWOptions() throws Throwable { .encryption("provider_managed") .operatingSystemFamily("Ubuntu Server") .operatingSystemArchitecture("amd64") - .zoneName("testString") + .zoneName("us-south-1") .build(); // Invoke listVolumes() with a valid options model and verify the result @@ -14224,7 +14416,7 @@ public void testListVolumesWOptions() throws Throwable { assertEquals(query.get("encryption"), "provider_managed"); assertEquals(query.get("operating_system.family"), "Ubuntu Server"); assertEquals(query.get("operating_system.architecture"), "amd64"); - assertEquals(query.get("zone.name"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); } // Test the listVolumes operation with and without retries enabled @@ -14241,8 +14433,8 @@ public void testListVolumesWRetries() throws Throwable { @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,\"attachment_state\":\"attached\",\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"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\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"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\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"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,\"attachment_state\":\"attached\",\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"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\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"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\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"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 mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"attachment_state\":\"attached\",\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"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/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"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,\"attachment_state\":\"attached\",\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"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/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"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) @@ -14263,7 +14455,7 @@ public void testListVolumesWithPagerGetNext() throws Throwable { .encryption("provider_managed") .operatingSystemFamily("Ubuntu Server") .operatingSystemArchitecture("amd64") - .zoneName("testString") + .zoneName("us-south-1") .build(); List allResults = new ArrayList<>(); @@ -14280,8 +14472,8 @@ public void testListVolumesWithPagerGetNext() throws Throwable { @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,\"attachment_state\":\"attached\",\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"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\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"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\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"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,\"attachment_state\":\"attached\",\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"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\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"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\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"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 mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"attachment_state\":\"attached\",\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"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/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"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,\"attachment_state\":\"attached\",\"bandwidth\":1000,\"busy\":true,\"capacity\":1000,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"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/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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\"}],\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"80b3e36e-41f4-40e9-bd56-beae81792a68\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"1e09281b-f177-46fb-baf1-bc152b2e391a\",\"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) @@ -14302,7 +14494,7 @@ public void testListVolumesWithPagerGetAll() throws Throwable { .encryption("provider_managed") .operatingSystemFamily("Ubuntu Server") .operatingSystemArchitecture("amd64") - .zoneName("testString") + .zoneName("us-south-1") .build(); VolumesPager pager = new VolumesPager(vpcService, listVolumesOptions); @@ -14315,7 +14507,7 @@ public void testListVolumesWithPagerGetAll() throws Throwable { @Test public void testCreateVolumeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"attachment_state\": \"attached\", \"bandwidth\": 1000, \"busy\": true, \"capacity\": 1000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"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\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"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\"}], \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"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 mockResponseBody = "{\"active\": true, \"attachment_state\": \"attached\", \"bandwidth\": 1000, \"busy\": true, \"capacity\": 1000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"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/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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\"}], \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"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") @@ -14453,7 +14645,7 @@ public void testDeleteVolumeNoOptions() throws Throwable { @Test public void testGetVolumeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"attachment_state\": \"attached\", \"bandwidth\": 1000, \"busy\": true, \"capacity\": 1000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"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\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"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\"}], \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"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 mockResponseBody = "{\"active\": true, \"attachment_state\": \"attached\", \"bandwidth\": 1000, \"busy\": true, \"capacity\": 1000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"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/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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\"}], \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"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") @@ -14506,7 +14698,7 @@ public void testGetVolumeNoOptions() throws Throwable { @Test public void testUpdateVolumeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"attachment_state\": \"attached\", \"bandwidth\": 1000, \"busy\": true, \"capacity\": 1000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"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\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"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\"}], \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"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 mockResponseBody = "{\"active\": true, \"attachment_state\": \"attached\", \"bandwidth\": 1000, \"busy\": true, \"capacity\": 1000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"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/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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\"}], \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"80b3e36e-41f4-40e9-bd56-beae81792a68\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::instance: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/instances/1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"1e09281b-f177-46fb-baf1-bc152b2e391a\", \"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") @@ -14629,7 +14821,7 @@ public void testDeleteSnapshotsNoOptions() throws Throwable { @Test public void testListSnapshotsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"user_tags\": [\"userTags\"]}], \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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\"}, \"user_tags\": [\"userTags\"]}], \"total_count\": 132}"; String listSnapshotsPath = "/snapshots"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -14644,12 +14836,20 @@ public void testListSnapshotsWOptions() throws Throwable { .resourceGroupId("testString") .name("testString") .sourceVolumeId("testString") - .sourceVolumeCrn("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .sourceImageId("testString") - .sourceImageCrn("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .sort("name") .backupPolicyPlanId("testString") - .clonesZoneName("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("testString") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-south") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") .build(); // Invoke listSnapshots() with a valid options model and verify the result @@ -14676,12 +14876,20 @@ public void testListSnapshotsWOptions() throws Throwable { assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("source_volume.id"), "testString"); - assertEquals(query.get("source_volume.crn"), "testString"); + assertEquals(query.get("source_volume.crn"), "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); assertEquals(query.get("source_image.id"), "testString"); - assertEquals(query.get("source_image.crn"), "testString"); + assertEquals(query.get("source_image.crn"), "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"); assertEquals(query.get("sort"), "name"); assertEquals(query.get("backup_policy_plan.id"), "testString"); - assertEquals(query.get("clones[].zone.name"), "testString"); + assertEquals(query.get("copies[].id"), "testString"); + assertEquals(query.get("copies[].name"), "my-snapshot-copy"); + assertEquals(query.get("copies[].crn"), "testString"); + 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-south"); + assertEquals(query.get("source_image.remote.region.name"), "us-south"); + assertEquals(query.get("clones[].zone.name"), "us-south-1"); } // Test the listSnapshots operation with and without retries enabled @@ -14698,8 +14906,8 @@ public void testListSnapshotsWRetries() throws Throwable { @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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"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\"}}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"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\"}}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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\"},\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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\"},\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -14719,12 +14927,20 @@ public void testListSnapshotsWithPagerGetNext() throws Throwable { .resourceGroupId("testString") .name("testString") .sourceVolumeId("testString") - .sourceVolumeCrn("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .sourceImageId("testString") - .sourceImageCrn("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .sort("name") .backupPolicyPlanId("testString") - .clonesZoneName("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("testString") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-south") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") .build(); List allResults = new ArrayList<>(); @@ -14741,8 +14957,8 @@ public void testListSnapshotsWithPagerGetNext() throws Throwable { @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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"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\"}}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"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\"}}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\"},\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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\"},\"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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r134-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\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"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-16-amd64\",\"name\":\"ubuntu-16-amd64\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"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,\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"aa2432b1fa4d4ace891e9b80fc104e34\",\"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"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\"},\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -14762,12 +14978,20 @@ public void testListSnapshotsWithPagerGetAll() throws Throwable { .resourceGroupId("testString") .name("testString") .sourceVolumeId("testString") - .sourceVolumeCrn("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .sourceImageId("testString") - .sourceImageCrn("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .sort("name") .backupPolicyPlanId("testString") - .clonesZoneName("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("testString") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-south") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") .build(); SnapshotsPager pager = new SnapshotsPager(vpcService, listSnapshotsOptions); @@ -14780,7 +15004,7 @@ public void testListSnapshotsWithPagerGetAll() throws Throwable { @Test public void testCreateSnapshotWOptions() 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"user_tags\": [\"userTags\"]}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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\"}, \"user_tags\": [\"userTags\"]}"; String createSnapshotPath = "/snapshots"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -14915,7 +15139,7 @@ public void testDeleteSnapshotNoOptions() throws Throwable { @Test public void testGetSnapshotWOptions() 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"user_tags\": [\"userTags\"]}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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\"}, \"user_tags\": [\"userTags\"]}"; String getSnapshotPath = "/snapshots/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -14968,7 +15192,7 @@ public void testGetSnapshotNoOptions() throws Throwable { @Test public void testUpdateSnapshotWOptions() 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"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\"}}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\"}, \"user_tags\": [\"userTags\"]}"; + 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/r134-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r134-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r134-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\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"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-16-amd64\", \"name\": \"ubuntu-16-amd64\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"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, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::image: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/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"aa2432b1fa4d4ace891e9b80fc104e34\", \"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/123456::snapshot:r134-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/r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r134-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"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/123456::volume: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/1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"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\"}, \"user_tags\": [\"userTags\"]}"; String updateSnapshotPath = "/snapshots/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -16929,8 +17153,8 @@ public void testListSecurityGroupsWOptions() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); // Invoke listSecurityGroups() with a valid options model and verify the result @@ -16955,8 +17179,8 @@ public void testListSecurityGroupsWOptions() throws Throwable { assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "testString"); - assertEquals(query.get("vpc.name"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); } // Test the listSecurityGroups operation with and without retries enabled @@ -16992,8 +17216,8 @@ public void testListSecurityGroupsWithPagerGetNext() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); List allResults = new ArrayList<>(); @@ -17029,8 +17253,8 @@ public void testListSecurityGroupsWithPagerGetAll() throws Throwable { .limit(Long.valueOf("10")) .resourceGroupId("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); SecurityGroupsPager pager = new SecurityGroupsPager(vpcService, listSecurityGroupsOptions); @@ -17993,7 +18217,7 @@ public void testCreateIkePolicyWOptions() throws Throwable { // Construct an instance of the CreateIkePolicyOptions model CreateIkePolicyOptions createIkePolicyOptionsModel = new CreateIkePolicyOptions.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("sha256") .dhGroup(Long.valueOf("14")) .encryptionAlgorithm("aes128") .ikeVersion(Long.valueOf("1")) @@ -18157,7 +18381,7 @@ public void testUpdateIkePolicyWOptions() throws Throwable { // Construct an instance of the IKEPolicyPatch model IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("sha256") .dhGroup(Long.valueOf("14")) .encryptionAlgorithm("aes128") .ikeVersion(Long.valueOf("1")) @@ -18662,7 +18886,7 @@ public void testListIpsecPolicyConnectionsNoOptions() throws Throwable { @Test public void testListVpnGatewaysWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20\"}, \"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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"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\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}]}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20\"}, \"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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"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\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}]}"; String listVpnGatewaysPath = "/vpn_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -18717,8 +18941,8 @@ public void testListVpnGatewaysWRetries() throws Throwable { @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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"private_ip\":{\"address\":\"192.168.3.4\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"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\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; - 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"private_ip\":{\"address\":\"192.168.3.4\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"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\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; + 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"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\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; + 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"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\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -18753,8 +18977,8 @@ public void testListVpnGatewaysWithPagerGetNext() throws Throwable { @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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"private_ip\":{\"address\":\"192.168.3.4\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"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\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; - 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"private_ip\":{\"address\":\"192.168.3.4\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"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\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; + 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"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\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; + 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\",\"id\":\"a10a5771-dc23-442c-8460-c3601d8542f7\",\"name\":\"my-vpn-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"members\":[{\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\",\"status\":\"available\"}],\"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\",\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"route\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -18785,7 +19009,7 @@ public void testListVpnGatewaysWithPagerGetAll() throws Throwable { @Test public void testCreateVpnGatewayWOptions() 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"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\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; + 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"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\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; String createVpnGatewayPath = "/vpn_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -18908,7 +19132,7 @@ public void testDeleteVpnGatewayNoOptions() throws Throwable { @Test public void testGetVpnGatewayWOptions() 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"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\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; + 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"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\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; String getVpnGatewayPath = "/vpn_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -18961,7 +19185,7 @@ public void testGetVpnGatewayNoOptions() throws Throwable { @Test public void testUpdateVpnGatewayWOptions() 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"private_ip\": {\"address\": \"192.168.3.4\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"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\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; + 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/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b\", \"id\": \"a10a5771-dc23-442c-8460-c3601d8542f7\", \"name\": \"my-vpn-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"members\": [{\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\", \"status\": \"available\"}], \"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\", \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"route\"}"; String updateVpnGatewayPath = "/vpn_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -19031,7 +19255,7 @@ public void testListVpnGatewayConnectionsWOptions() throws Throwable { // Construct an instance of the ListVpnGatewayConnectionsOptions model ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptionsModel = new ListVpnGatewayConnectionsOptions.Builder() .vpnGatewayId("testString") - .status("testString") + .status("down") .build(); // Invoke listVpnGatewayConnections() with a valid options model and verify the result @@ -19052,7 +19276,7 @@ public void testListVpnGatewayConnectionsWOptions() throws Throwable { assertNotNull(query); assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("status"), "testString"); + assertEquals(query.get("status"), "down"); } // Test the listVpnGatewayConnections operation with and without retries enabled @@ -20901,7 +21125,7 @@ public void testUpdateVpnServerRouteNoOptions() throws Throwable { @Test public void testListLoadBalancerProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"profiles\": [{\"family\": \"network\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"logging_supported\": {\"type\": \"fixed\", \"value\": [\"datapath\"]}, \"name\": \"network-fixed\", \"route_mode_supported\": {\"type\": \"fixed\", \"value\": true}, \"security_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"udp_supported\": {\"type\": \"fixed\", \"value\": true}}], \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20\"}, \"limit\": 20, \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20\"}, \"profiles\": [{\"family\": \"network\", \"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}, \"udp_supported\": {\"type\": \"fixed\", \"value\": true}}], \"total_count\": 132}"; String listLoadBalancerProfilesPath = "/load_balancer/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -20950,8 +21174,8 @@ public void testListLoadBalancerProfilesWRetries() throws Throwable { @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\":[{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"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},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"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},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -20983,8 +21207,8 @@ public void testListLoadBalancerProfilesWithPagerGetNext() throws Throwable { @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\":[{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"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},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"network\",\"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},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -21012,7 +21236,7 @@ public void testListLoadBalancerProfilesWithPagerGetAll() throws Throwable { @Test public void testGetLoadBalancerProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"family\": \"network\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"logging_supported\": {\"type\": \"fixed\", \"value\": [\"datapath\"]}, \"name\": \"network-fixed\", \"route_mode_supported\": {\"type\": \"fixed\", \"value\": true}, \"security_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"udp_supported\": {\"type\": \"fixed\", \"value\": true}}"; + String mockResponseBody = "{\"family\": \"network\", \"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}, \"udp_supported\": {\"type\": \"fixed\", \"value\": true}}"; String getLoadBalancerProfilePath = "/load_balancer/profiles/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -21065,7 +21289,7 @@ public void testGetLoadBalancerProfileNoOptions() throws Throwable { @Test public void testListLoadBalancersWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20\"}, \"limit\": 20, \"load_balancers\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"70294e14-4e61-11e8-bcf4-0242ac110004\"}], \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"network\", \"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}], \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20\"}, \"total_count\": 132}"; + String mockResponseBody = "{\"first\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20\"}, \"limit\": 20, \"load_balancers\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": false, \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"70294e14-4e61-11e8-bcf4-0242ac110004\"}], \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"network\", \"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}], \"next\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20\"}, \"total_count\": 132}"; String listLoadBalancersPath = "/load_balancers"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") @@ -21114,8 +21338,8 @@ public void testListLoadBalancersWRetries() throws Throwable { @Test 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\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":false,\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":false,\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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) @@ -21147,8 +21371,8 @@ public void testListLoadBalancersWithPagerGetNext() throws Throwable { @Test 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\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":false,\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":false,\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"70294e14-4e61-11e8-bcf4-0242ac110004\"}],\"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"network\",\"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"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) @@ -21176,7 +21400,7 @@ public void testListLoadBalancersWithPagerGetAll() throws Throwable { @Test public void testCreateLoadBalancerWOptions() 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/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"70294e14-4e61-11e8-bcf4-0242ac110004\"}], \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"network\", \"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": false, \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"70294e14-4e61-11e8-bcf4-0242ac110004\"}], \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"network\", \"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -21414,7 +21638,7 @@ public void testDeleteLoadBalancerNoOptions() throws Throwable { @Test public void testGetLoadBalancerWOptions() 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/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"70294e14-4e61-11e8-bcf4-0242ac110004\"}], \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"network\", \"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": false, \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"70294e14-4e61-11e8-bcf4-0242ac110004\"}], \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"network\", \"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -21467,7 +21691,7 @@ public void testGetLoadBalancerNoOptions() throws Throwable { @Test public void testUpdateLoadBalancerWOptions() 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/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"70294e14-4e61-11e8-bcf4-0242ac110004\"}], \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"network\", \"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/fff1cdf3dc1e4ec692a5f78bbb2584bc:6860c359-b2e2-46fa-a944-b38c28201c6e\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": false, \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"70294e14-4e61-11e8-bcf4-0242ac110004\"}], \"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/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"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/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"network\", \"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/123456::security-group: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/be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"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") @@ -23929,10 +24153,10 @@ public void testListFlowLogCollectorsWOptions() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .targetId("testString") - .targetResourceType("instance") + .targetResourceType("testString") .build(); // Invoke listFlowLogCollectors() with a valid options model and verify the result @@ -23958,10 +24182,10 @@ public void testListFlowLogCollectorsWOptions() throws Throwable { assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "testString"); assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "testString"); - assertEquals(query.get("vpc.name"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); assertEquals(query.get("target.id"), "testString"); - assertEquals(query.get("target.resource_type"), "instance"); + assertEquals(query.get("target.resource_type"), "testString"); } // Test the listFlowLogCollectors operation with and without retries enabled @@ -23998,10 +24222,10 @@ public void testListFlowLogCollectorsWithPagerGetNext() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .targetId("testString") - .targetResourceType("instance") + .targetResourceType("testString") .build(); List allResults = new ArrayList<>(); @@ -24038,10 +24262,10 @@ public void testListFlowLogCollectorsWithPagerGetAll() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .targetId("testString") - .targetResourceType("instance") + .targetResourceType("testString") .build(); FlowLogCollectorsPager pager = new FlowLogCollectorsPager(vpcService, listFlowLogCollectorsOptions); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/AccountReferenceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/AccountReferenceTest.java new file mode 100644 index 0000000000..622ff654e6 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/AccountReferenceTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.AccountReference; +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 AccountReference model. + */ +public class AccountReferenceTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAccountReference() throws Throwable { + AccountReference accountReferenceModel = new AccountReference(); + assertNull(accountReferenceModel.getId()); + assertNull(accountReferenceModel.getResourceType()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionTest.java index d4896c0b69..8e7612295f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyCollectionTest.java @@ -19,6 +19,8 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyCollectionNext; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; +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.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/BackupPolicyJobCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobCollectionTest.java index 88f4b1983a..2b19725999 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobCollectionTest.java @@ -21,9 +21,13 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyJobStatusReason; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; 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/BackupPolicyJobSourceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceTest.java index 04d1fee818..5dfbdd439a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceTest.java @@ -14,7 +14,9 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyJobSource; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; 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/BackupPolicyJobSourceVolumeReferenceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceVolumeReferenceTest.java index 7bf58e7c28..b0450465bd 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceVolumeReferenceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobSourceVolumeReferenceTest.java @@ -14,7 +14,9 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyJobSourceVolumeReference; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -38,5 +40,7 @@ public void testBackupPolicyJobSourceVolumeReference() throws Throwable { assertNull(backupPolicyJobSourceVolumeReferenceModel.getHref()); assertNull(backupPolicyJobSourceVolumeReferenceModel.getId()); assertNull(backupPolicyJobSourceVolumeReferenceModel.getName()); + assertNull(backupPolicyJobSourceVolumeReferenceModel.getRemote()); + assertNull(backupPolicyJobSourceVolumeReferenceModel.getResourceType()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobTest.java index 5baf8e90b3..306e1ad207 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyJobTest.java @@ -18,9 +18,13 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyJobStatusReason; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; 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/BackupPolicyPlanCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollectionTest.java index edc6e2ec34..3372a02567 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanCollectionTest.java @@ -17,6 +17,9 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanClonePolicy; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanCollection; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanDeletionTrigger; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicy; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.ZoneReference; 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/BackupPolicyPlanPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatchTest.java index a6206f92d1..41872c0f65 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPatchTest.java @@ -16,6 +16,9 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanClonePolicyPatch; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanDeletionTriggerPatch; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanPatch; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicyPrototype; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByName; import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -54,6 +57,25 @@ public void testBackupPolicyPlanPatch() throws Throwable { assertEquals(backupPolicyPlanDeletionTriggerPatchModel.deleteAfter(), Long.valueOf("20")); assertEquals(backupPolicyPlanDeletionTriggerPatchModel.deleteOverCount(), Long.valueOf("1")); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + assertEquals(regionIdentityModel.name(), "us-south"); + + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.deleteOverCount(), Long.valueOf("1")); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.region(), regionIdentityModel); + BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() .active(true) .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) @@ -62,6 +84,7 @@ public void testBackupPolicyPlanPatch() throws Throwable { .cronSpec("30 */2 * * 1-5") .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); assertEquals(backupPolicyPlanPatchModel.active(), Boolean.valueOf(true)); assertEquals(backupPolicyPlanPatchModel.attachUserTags(), java.util.Arrays.asList("my-daily-backup-plan")); @@ -70,6 +93,7 @@ public void testBackupPolicyPlanPatch() throws Throwable { assertEquals(backupPolicyPlanPatchModel.cronSpec(), "30 */2 * * 1-5"); assertEquals(backupPolicyPlanPatchModel.deletionTrigger(), backupPolicyPlanDeletionTriggerPatchModel); assertEquals(backupPolicyPlanPatchModel.name(), "my-policy-plan"); + assertEquals(backupPolicyPlanPatchModel.remoteRegionPolicies(), java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)); String json = TestUtilities.serialize(backupPolicyPlanPatchModel); @@ -98,6 +122,20 @@ public void testBackupPolicyPlanPatchAsPatch() throws Throwable { .deleteOverCount(Long.valueOf("1")) .build(); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87: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("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() .active(true) .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) @@ -106,6 +144,7 @@ public void testBackupPolicyPlanPatchAsPatch() throws Throwable { .cronSpec("30 */2 * * 1-5") .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); Map mergePatch = backupPolicyPlanPatchModel.asPatch(); @@ -117,6 +156,7 @@ public void testBackupPolicyPlanPatchAsPatch() throws Throwable { assertEquals(mergePatch.get("cron_spec"), "30 */2 * * 1-5"); assertTrue(mergePatch.containsKey("deletion_trigger")); assertEquals(mergePatch.get("name"), "my-policy-plan"); + assertTrue(mergePatch.containsKey("remote_region_policies")); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototypeTest.java index b7e81c2ea8..58f3532691 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanPrototypeTest.java @@ -16,6 +16,9 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanClonePolicyPrototype; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanDeletionTriggerPrototype; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanPrototype; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicyPrototype; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByName; import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -53,6 +56,25 @@ public void testBackupPolicyPlanPrototype() throws Throwable { assertEquals(backupPolicyPlanDeletionTriggerPrototypeModel.deleteAfter(), Long.valueOf("20")); assertEquals(backupPolicyPlanDeletionTriggerPrototypeModel.deleteOverCount(), Long.valueOf("20")); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + assertEquals(regionIdentityModel.name(), "us-south"); + + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.deleteOverCount(), Long.valueOf("1")); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.region(), regionIdentityModel); + BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() .active(true) .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) @@ -61,6 +83,7 @@ public void testBackupPolicyPlanPrototype() throws Throwable { .cronSpec("30 */2 * * 1-5") .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); assertEquals(backupPolicyPlanPrototypeModel.active(), Boolean.valueOf(true)); assertEquals(backupPolicyPlanPrototypeModel.attachUserTags(), java.util.Arrays.asList("my-daily-backup-plan")); @@ -69,6 +92,7 @@ public void testBackupPolicyPlanPrototype() throws Throwable { assertEquals(backupPolicyPlanPrototypeModel.cronSpec(), "30 */2 * * 1-5"); assertEquals(backupPolicyPlanPrototypeModel.deletionTrigger(), backupPolicyPlanDeletionTriggerPrototypeModel); assertEquals(backupPolicyPlanPrototypeModel.name(), "my-policy-plan"); + assertEquals(backupPolicyPlanPrototypeModel.remoteRegionPolicies(), java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)); String json = TestUtilities.serialize(backupPolicyPlanPrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReferenceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReferenceTest.java index 45b25579fa..b3828ed528 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReferenceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanReferenceTest.java @@ -15,6 +15,8 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -37,6 +39,7 @@ public void testBackupPolicyPlanReference() throws Throwable { assertNull(backupPolicyPlanReferenceModel.getHref()); assertNull(backupPolicyPlanReferenceModel.getId()); assertNull(backupPolicyPlanReferenceModel.getName()); + assertNull(backupPolicyPlanReferenceModel.getRemote()); assertNull(backupPolicyPlanReferenceModel.getResourceType()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyPrototypeTest.java new file mode 100644 index 0000000000..1c9c16901f --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyPrototypeTest.java @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.BackupPolicyPlanRemoteRegionPolicyPrototype; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByName; +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 BackupPolicyPlanRemoteRegionPolicyPrototype model. + */ +public class BackupPolicyPlanRemoteRegionPolicyPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBackupPolicyPlanRemoteRegionPolicyPrototype() throws Throwable { + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + assertEquals(regionIdentityModel.name(), "us-south"); + + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.deleteOverCount(), Long.valueOf("1")); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.region(), regionIdentityModel); + + String json = TestUtilities.serialize(backupPolicyPlanRemoteRegionPolicyPrototypeModel); + + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModelNew = TestUtilities.deserialize(json, BackupPolicyPlanRemoteRegionPolicyPrototype.class); + assertTrue(backupPolicyPlanRemoteRegionPolicyPrototypeModelNew instanceof BackupPolicyPlanRemoteRegionPolicyPrototype); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModelNew.deleteOverCount(), Long.valueOf("1")); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModelNew.region().toString(), regionIdentityModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testBackupPolicyPlanRemoteRegionPolicyPrototypeError() throws Throwable { + new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyTest.java new file mode 100644 index 0000000000..eba270857e --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteRegionPolicyTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.BackupPolicyPlanRemoteRegionPolicy; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; +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 BackupPolicyPlanRemoteRegionPolicy model. + */ +public class BackupPolicyPlanRemoteRegionPolicyTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBackupPolicyPlanRemoteRegionPolicy() throws Throwable { + BackupPolicyPlanRemoteRegionPolicy backupPolicyPlanRemoteRegionPolicyModel = new BackupPolicyPlanRemoteRegionPolicy(); + assertNull(backupPolicyPlanRemoteRegionPolicyModel.getDeleteOverCount()); + assertNull(backupPolicyPlanRemoteRegionPolicyModel.getEncryptionKey()); + assertNull(backupPolicyPlanRemoteRegionPolicyModel.getRegion()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteTest.java new file mode 100644 index 0000000000..e4b12aa088 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanRemoteTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.BackupPolicyPlanRemote; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; +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 BackupPolicyPlanRemote model. + */ +public class BackupPolicyPlanRemoteTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBackupPolicyPlanRemote() throws Throwable { + BackupPolicyPlanRemote backupPolicyPlanRemoteModel = new BackupPolicyPlanRemote(); + assertNull(backupPolicyPlanRemoteModel.getRegion()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanTest.java index a5ed2ef289..295f2dee1a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPlanTest.java @@ -16,6 +16,9 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlan; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanClonePolicy; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanDeletionTrigger; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicy; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.ZoneReference; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -46,6 +49,7 @@ public void testBackupPolicyPlan() throws Throwable { assertNull(backupPolicyPlanModel.getId()); assertNull(backupPolicyPlanModel.getLifecycleState()); assertNull(backupPolicyPlanModel.getName()); + assertNull(backupPolicyPlanModel.getRemoteRegionPolicies()); assertNull(backupPolicyPlanModel.getResourceType()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyTest.java index 66106a2bbd..869b1d355d 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyTest.java @@ -16,6 +16,8 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicy; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; +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.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/BareMetalServerInitializationTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationTest.java index e5c1691811..8419e54f61 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 @@ -13,12 +13,15 @@ package com.ibm.cloud.is.vpc.v1.model; +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.BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.KeyReference; import com.ibm.cloud.is.vpc.v1.model.KeyReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; 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/CreateBackupPolicyOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptionsTest.java index c1e6da7e1e..39a088ed78 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyOptionsTest.java @@ -16,7 +16,10 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanClonePolicyPrototype; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanDeletionTriggerPrototype; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanPrototype; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicyPrototype; import com.ibm.cloud.is.vpc.v1.model.CreateBackupPolicyOptions; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByName; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -55,6 +58,25 @@ public void testCreateBackupPolicyOptions() throws Throwable { assertEquals(backupPolicyPlanDeletionTriggerPrototypeModel.deleteAfter(), Long.valueOf("20")); assertEquals(backupPolicyPlanDeletionTriggerPrototypeModel.deleteOverCount(), Long.valueOf("20")); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + assertEquals(regionIdentityModel.name(), "us-south"); + + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.deleteOverCount(), Long.valueOf("1")); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.region(), regionIdentityModel); + BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() .active(true) .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) @@ -63,6 +85,7 @@ public void testCreateBackupPolicyOptions() throws Throwable { .cronSpec("30 */2 * * 1-5") .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); assertEquals(backupPolicyPlanPrototypeModel.active(), Boolean.valueOf(true)); assertEquals(backupPolicyPlanPrototypeModel.attachUserTags(), java.util.Arrays.asList("my-daily-backup-plan")); @@ -71,6 +94,7 @@ public void testCreateBackupPolicyOptions() throws Throwable { assertEquals(backupPolicyPlanPrototypeModel.cronSpec(), "30 */2 * * 1-5"); assertEquals(backupPolicyPlanPrototypeModel.deletionTrigger(), backupPolicyPlanDeletionTriggerPrototypeModel); assertEquals(backupPolicyPlanPrototypeModel.name(), "my-policy-plan"); + assertEquals(backupPolicyPlanPrototypeModel.remoteRegionPolicies(), java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptionsTest.java index 3ed2c2efe9..44d8f2ae80 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBackupPolicyPlanOptionsTest.java @@ -15,7 +15,10 @@ import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanClonePolicyPrototype; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanDeletionTriggerPrototype; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemoteRegionPolicyPrototype; import com.ibm.cloud.is.vpc.v1.model.CreateBackupPolicyPlanOptions; +import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.RegionIdentityByName; import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -53,6 +56,25 @@ public void testCreateBackupPolicyPlanOptions() throws Throwable { assertEquals(backupPolicyPlanDeletionTriggerPrototypeModel.deleteAfter(), Long.valueOf("20")); assertEquals(backupPolicyPlanDeletionTriggerPrototypeModel.deleteOverCount(), Long.valueOf("20")); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + assertEquals(regionIdentityModel.name(), "us-south"); + + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("1")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.deleteOverCount(), Long.valueOf("1")); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(backupPolicyPlanRemoteRegionPolicyPrototypeModel.region(), regionIdentityModel); + CreateBackupPolicyPlanOptions createBackupPolicyPlanOptionsModel = new CreateBackupPolicyPlanOptions.Builder() .backupPolicyId("testString") .cronSpec("30 */2 * * 1-5") @@ -62,6 +84,7 @@ public void testCreateBackupPolicyPlanOptions() throws Throwable { .copyUserTags(true) .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); assertEquals(createBackupPolicyPlanOptionsModel.backupPolicyId(), "testString"); assertEquals(createBackupPolicyPlanOptionsModel.cronSpec(), "30 */2 * * 1-5"); @@ -71,6 +94,7 @@ public void testCreateBackupPolicyPlanOptions() throws Throwable { assertEquals(createBackupPolicyPlanOptionsModel.copyUserTags(), Boolean.valueOf(true)); assertEquals(createBackupPolicyPlanOptionsModel.deletionTrigger(), backupPolicyPlanDeletionTriggerPrototypeModel); assertEquals(createBackupPolicyPlanOptionsModel.name(), "my-policy-plan"); + assertEquals(createBackupPolicyPlanOptionsModel.remoteRegionPolicies(), java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptionsTest.java index 4663dbdeb1..6bbe719d22 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptionsTest.java @@ -38,7 +38,7 @@ public void testCreateIkePolicyOptions() throws Throwable { assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); CreateIkePolicyOptions createIkePolicyOptionsModel = new CreateIkePolicyOptions.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("sha256") .dhGroup(Long.valueOf("14")) .encryptionAlgorithm("aes128") .ikeVersion(Long.valueOf("1")) @@ -46,7 +46,7 @@ public void testCreateIkePolicyOptions() throws Throwable { .name("my-ike-policy") .resourceGroup(resourceGroupIdentityModel) .build(); - assertEquals(createIkePolicyOptionsModel.authenticationAlgorithm(), "md5"); + assertEquals(createIkePolicyOptionsModel.authenticationAlgorithm(), "sha256"); assertEquals(createIkePolicyOptionsModel.dhGroup(), Long.valueOf("14")); assertEquals(createIkePolicyOptionsModel.encryptionAlgorithm(), "aes128"); assertEquals(createIkePolicyOptionsModel.ikeVersion(), Long.valueOf("1")); 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 1e98d1e6b7..76d422a09b 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 @@ -21,6 +21,7 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; 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; @@ -57,14 +58,18 @@ public void testCreateImageOptions() throws Throwable { assertEquals(operatingSystemIdentityModel.name(), "ubuntu-16-amd64"); 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(); + 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")); assertEquals(imagePrototypeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(imagePrototypeModel.encryptedDataKey(), "testString"); assertEquals(imagePrototypeModel.encryptionKey(), encryptionKeyIdentityModel); 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 307881faf9..22afe50801 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 @@ -134,6 +134,7 @@ public void testCreateInstanceOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -141,6 +142,7 @@ public void testCreateInstanceOptions() throws Throwable { assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() 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 536fce6503..1055e7f9eb 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 @@ -21,7 +21,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImage; 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; @@ -134,6 +134,7 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -141,6 +142,7 @@ public void testCreateInstanceTemplateOptions() throws Throwable { assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() @@ -194,7 +196,7 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .build(); assertEquals(zoneIdentityModel.name(), "us-south-1"); - InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.Builder() + InstanceTemplatePrototypeInstanceTemplateByImage instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceTemplateByImage.Builder() .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) .keys(java.util.Arrays.asList(keyIdentityModel)) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteResponseTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteResponseTest.java new file mode 100644 index 0000000000..37771421a2 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcRouteResponseTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.CreateVpcRouteResponse; +import com.ibm.cloud.is.vpc.v1.model.RouteNextHopIP; +import com.ibm.cloud.is.vpc.v1.model.ZoneReference; +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 CreateVpcRouteResponse model. + */ +public class CreateVpcRouteResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateVpcRouteResponse() throws Throwable { + CreateVpcRouteResponse createVpcRouteResponseModel = new CreateVpcRouteResponse(); + assertNull(createVpcRouteResponseModel.getAction()); + assertNull(createVpcRouteResponseModel.getCreatedAt()); + assertNull(createVpcRouteResponseModel.getDestination()); + assertNull(createVpcRouteResponseModel.getHref()); + assertNull(createVpcRouteResponseModel.getId()); + assertNull(createVpcRouteResponseModel.getLifecycleState()); + assertNull(createVpcRouteResponseModel.getName()); + assertNull(createVpcRouteResponseModel.getNextHop()); + assertNull(createVpcRouteResponseModel.getPriority()); + assertNull(createVpcRouteResponseModel.getZone()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteResponseTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteResponseTest.java new file mode 100644 index 0000000000..3fd5cff062 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetVpcRouteResponseTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.GetVpcRouteResponse; +import com.ibm.cloud.is.vpc.v1.model.RouteNextHopIP; +import com.ibm.cloud.is.vpc.v1.model.ZoneReference; +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 GetVpcRouteResponse model. + */ +public class GetVpcRouteResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetVpcRouteResponse() throws Throwable { + GetVpcRouteResponse getVpcRouteResponseModel = new GetVpcRouteResponse(); + assertNull(getVpcRouteResponseModel.getAction()); + assertNull(getVpcRouteResponseModel.getCreatedAt()); + assertNull(getVpcRouteResponseModel.getDestination()); + assertNull(getVpcRouteResponseModel.getHref()); + assertNull(getVpcRouteResponseModel.getId()); + assertNull(getVpcRouteResponseModel.getLifecycleState()); + assertNull(getVpcRouteResponseModel.getName()); + assertNull(getVpcRouteResponseModel.getNextHop()); + assertNull(getVpcRouteResponseModel.getPriority()); + assertNull(getVpcRouteResponseModel.getZone()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatchTest.java index d3979f515d..9faed11f8b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/IKEPolicyPatchTest.java @@ -33,14 +33,14 @@ public class IKEPolicyPatchTest { @Test public void testIKEPolicyPatch() throws Throwable { IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("sha256") .dhGroup(Long.valueOf("14")) .encryptionAlgorithm("aes128") .ikeVersion(Long.valueOf("1")) .keyLifetime(Long.valueOf("28800")) .name("my-ike-policy") .build(); - assertEquals(ikePolicyPatchModel.authenticationAlgorithm(), "md5"); + assertEquals(ikePolicyPatchModel.authenticationAlgorithm(), "sha256"); assertEquals(ikePolicyPatchModel.dhGroup(), Long.valueOf("14")); assertEquals(ikePolicyPatchModel.encryptionAlgorithm(), "aes128"); assertEquals(ikePolicyPatchModel.ikeVersion(), Long.valueOf("1")); @@ -51,7 +51,7 @@ public void testIKEPolicyPatch() throws Throwable { IKEPolicyPatch ikePolicyPatchModelNew = TestUtilities.deserialize(json, IKEPolicyPatch.class); assertTrue(ikePolicyPatchModelNew instanceof IKEPolicyPatch); - assertEquals(ikePolicyPatchModelNew.authenticationAlgorithm(), "md5"); + assertEquals(ikePolicyPatchModelNew.authenticationAlgorithm(), "sha256"); assertEquals(ikePolicyPatchModelNew.dhGroup(), Long.valueOf("14")); assertEquals(ikePolicyPatchModelNew.encryptionAlgorithm(), "aes128"); assertEquals(ikePolicyPatchModelNew.ikeVersion(), Long.valueOf("1")); @@ -61,7 +61,7 @@ public void testIKEPolicyPatch() throws Throwable { @Test public void testIKEPolicyPatchAsPatch() throws Throwable { IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() - .authenticationAlgorithm("md5") + .authenticationAlgorithm("sha256") .dhGroup(Long.valueOf("14")) .encryptionAlgorithm("aes128") .ikeVersion(Long.valueOf("1")) @@ -71,7 +71,7 @@ public void testIKEPolicyPatchAsPatch() throws Throwable { Map mergePatch = ikePolicyPatchModel.asPatch(); - assertEquals(mergePatch.get("authentication_algorithm"), "md5"); + assertEquals(mergePatch.get("authentication_algorithm"), "sha256"); assertTrue(mergePatch.containsKey("dh_group")); assertEquals(mergePatch.get("encryption_algorithm"), "aes128"); assertTrue(mergePatch.containsKey("ike_version")); 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 cba562d327..e151111da7 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 @@ -24,9 +24,11 @@ import com.ibm.cloud.is.vpc.v1.model.ImageFileChecksums; import com.ibm.cloud.is.vpc.v1.model.ImageStatusReason; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; +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.VolumeReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; 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; @@ -50,5 +52,6 @@ public void testImageCollection() throws Throwable { assertNull(imageCollectionModel.getImages()); assertNull(imageCollectionModel.getLimit()); assertNull(imageCollectionModel.getNext()); + assertNull(imageCollectionModel.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 59e2a6241b..6a56945961 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 @@ -16,6 +16,7 @@ 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; +import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; import java.util.HashMap; import java.util.List; @@ -33,25 +34,35 @@ public class ImagePatchTest { @Test public void testImagePatch() throws Throwable { 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(); + 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")); String json = TestUtilities.serialize(imagePatchModel); ImagePatch imagePatchModelNew = TestUtilities.deserialize(json, ImagePatch.class); assertTrue(imagePatchModelNew instanceof ImagePatch); + 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 { 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 mergePatch = imagePatchModel.asPatch(); + assertTrue(mergePatch.containsKey("deprecation_at")); assertEquals(mergePatch.get("name"), "my-image"); + assertTrue(mergePatch.containsKey("obsolescence_at")); } } \ No newline at end of file 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 85d8ad8611..81b66a170a 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 @@ -20,6 +20,7 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; 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; @@ -56,14 +57,18 @@ public void testImagePrototypeImageByFile() throws Throwable { assertEquals(operatingSystemIdentityModel.name(), "ubuntu-16-amd64"); ImagePrototypeImageByFile imagePrototypeImageByFileModel = 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(); + 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")); assertEquals(imagePrototypeImageByFileModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(imagePrototypeImageByFileModel.encryptedDataKey(), "testString"); assertEquals(imagePrototypeImageByFileModel.encryptionKey(), encryptionKeyIdentityModel); @@ -74,7 +79,9 @@ public void testImagePrototypeImageByFile() throws Throwable { ImagePrototypeImageByFile imagePrototypeImageByFileModelNew = TestUtilities.deserialize(json, ImagePrototypeImageByFile.class); assertTrue(imagePrototypeImageByFileModelNew instanceof ImagePrototypeImageByFile); + 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")); assertEquals(imagePrototypeImageByFileModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(imagePrototypeImageByFileModelNew.encryptedDataKey(), "testString"); assertEquals(imagePrototypeImageByFileModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); 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 b8aad70b3e..b173d2fd80 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 @@ -19,6 +19,7 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityById; 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; @@ -50,12 +51,16 @@ public void testImagePrototypeImageBySourceVolume() throws Throwable { assertEquals(volumeIdentityModel.id(), "1e09281b-f177-46fb-baf1-bc152b2e391a"); ImagePrototypeImageBySourceVolume imagePrototypeImageBySourceVolumeModel = new ImagePrototypeImageBySourceVolume.Builder() + .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .name("my-image") + .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .resourceGroup(resourceGroupIdentityModel) .encryptionKey(encryptionKeyIdentityModel) .sourceVolume(volumeIdentityModel) .build(); + 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")); assertEquals(imagePrototypeImageBySourceVolumeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(imagePrototypeImageBySourceVolumeModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(imagePrototypeImageBySourceVolumeModel.sourceVolume(), volumeIdentityModel); @@ -64,7 +69,9 @@ public void testImagePrototypeImageBySourceVolume() throws Throwable { ImagePrototypeImageBySourceVolume imagePrototypeImageBySourceVolumeModelNew = TestUtilities.deserialize(json, ImagePrototypeImageBySourceVolume.class); assertTrue(imagePrototypeImageBySourceVolumeModelNew instanceof ImagePrototypeImageBySourceVolume); + 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")); assertEquals(imagePrototypeImageBySourceVolumeModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(imagePrototypeImageBySourceVolumeModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); assertEquals(imagePrototypeImageBySourceVolumeModelNew.sourceVolume().toString(), volumeIdentityModel.toString()); 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 c75be13a01..a5ac6d8500 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 @@ -20,6 +20,7 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; 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; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageReferenceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageReferenceTest.java index c7c31c941f..7b4075058b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageReferenceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageReferenceTest.java @@ -13,8 +13,11 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -38,5 +41,7 @@ public void testImageReference() throws Throwable { assertNull(imageReferenceModel.getHref()); assertNull(imageReferenceModel.getId()); assertNull(imageReferenceModel.getName()); + assertNull(imageReferenceModel.getRemote()); + assertNull(imageReferenceModel.getResourceType()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageRemoteTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageRemoteTest.java new file mode 100644 index 0000000000..670d9f2d9e --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageRemoteTest.java @@ -0,0 +1,40 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.AccountReference; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; +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 ImageRemote model. + */ +public class ImageRemoteTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImageRemote() throws Throwable { + ImageRemote imageRemoteModel = new ImageRemote(); + assertNull(imageRemoteModel.getAccount()); + assertNull(imageRemoteModel.getRegion()); + } +} \ No newline at end of file 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 016204902c..bc56a9e073 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 @@ -21,9 +21,11 @@ import com.ibm.cloud.is.vpc.v1.model.ImageFileChecksums; import com.ibm.cloud.is.vpc.v1.model.ImageStatusReason; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; +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.VolumeReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -45,6 +47,7 @@ public void testImage() throws Throwable { assertNull(imageModel.getCatalogOffering()); assertNull(imageModel.getCreatedAt()); assertNull(imageModel.getCrn()); + assertNull(imageModel.getDeprecationAt()); assertNull(imageModel.getEncryption()); assertNull(imageModel.getEncryptionKey()); assertNull(imageModel.getFile()); @@ -52,8 +55,10 @@ public void testImage() throws Throwable { assertNull(imageModel.getId()); assertNull(imageModel.getMinimumProvisionedSize()); assertNull(imageModel.getName()); + assertNull(imageModel.getObsolescenceAt()); assertNull(imageModel.getOperatingSystem()); assertNull(imageModel.getResourceGroup()); + assertNull(imageModel.getResourceType()); assertNull(imageModel.getSourceVolume()); assertNull(imageModel.getStatus()); assertNull(imageModel.getStatusReasons()); 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 4a99b0ee41..c280aa9957 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 @@ -13,12 +13,14 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.Instance; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPolicy; import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOffering; @@ -35,6 +37,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReference; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.ReservedIPReference; import com.ibm.cloud.is.vpc.v1.model.ReservedIPReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; 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 0340ebabfe..cef2195f0f 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 @@ -134,6 +134,7 @@ public void testInstancePrototypeInstanceByCatalogOffering() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -141,6 +142,7 @@ public void testInstancePrototypeInstanceByCatalogOffering() throws Throwable { assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() 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 ef8469768b..fffba389e6 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 @@ -133,6 +133,7 @@ public void testInstancePrototypeInstanceByImage() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -140,6 +141,7 @@ public void testInstancePrototypeInstanceByImage() throws Throwable { assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() 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 6dfaaf1c8d..a2d6dee7bc 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 @@ -138,6 +138,7 @@ public void testInstancePrototypeInstanceBySourceSnapshot() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); @@ -146,6 +147,7 @@ public void testInstancePrototypeInstanceBySourceSnapshot() throws Throwable { assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.sourceSnapshot(), snapshotIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.userTags(), java.util.Arrays.asList("testString")); 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 66ed75e293..50fde2db08 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 @@ -136,6 +136,7 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -143,6 +144,7 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() 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 68aa7eb7fc..5fb245bc57 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 @@ -23,10 +23,11 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateCollectionNext; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImageInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImage; 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; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; 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/InstanceTemplateInstanceByCatalogOfferingTest.java similarity index 51% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingTest.java index e5a2f5f317..0f2ba1ffd8 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/InstanceTemplateInstanceByCatalogOfferingTest.java @@ -21,10 +21,11 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOffering; 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; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; @@ -45,35 +46,35 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext model. + * Unit test class for the InstanceTemplateInstanceByCatalogOffering model. */ -public class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextTest { +public class InstanceTemplateInstanceByCatalogOfferingTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() throws Throwable { - InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel = new InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getAvailabilityPolicy()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getCreatedAt()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getCrn()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getDefaultTrustedProfile()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getHref()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getId()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getKeys()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getMetadataService()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getName()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getPlacementTarget()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getProfile()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getResourceGroup()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getTotalVolumeBandwidth()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getUserData()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getVolumeAttachments()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getVpc()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getBootVolumeAttachment()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getCatalogOffering()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getNetworkInterfaces()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getPrimaryNetworkInterface()); - assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextModel.getZone()); + public void testInstanceTemplateInstanceByCatalogOffering() throws Throwable { + InstanceTemplateInstanceByCatalogOffering instanceTemplateInstanceByCatalogOfferingModel = new InstanceTemplateInstanceByCatalogOffering(); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getAvailabilityPolicy()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getCreatedAt()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getCrn()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getDefaultTrustedProfile()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getHref()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getId()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getKeys()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getMetadataService()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getName()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getPlacementTarget()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getProfile()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getResourceGroup()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getTotalVolumeBandwidth()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getUserData()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getVpc()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getBootVolumeAttachment()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getCatalogOffering()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getNetworkInterfaces()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getPrimaryNetworkInterface()); + assertNull(instanceTemplateInstanceByCatalogOfferingModel.getZone()); } } \ No newline at end of file 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/InstanceTemplateInstanceByImageTest.java similarity index 52% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageTest.java index 88b01eac8d..3014e7c97d 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/InstanceTemplateInstanceByImageTest.java @@ -20,10 +20,11 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImageInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImage; 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; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; @@ -44,35 +45,35 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceTemplateInstanceByImageInstanceTemplateContext model. + * Unit test class for the InstanceTemplateInstanceByImage model. */ -public class InstanceTemplateInstanceByImageInstanceTemplateContextTest { +public class InstanceTemplateInstanceByImageTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceTemplateInstanceByImageInstanceTemplateContext() throws Throwable { - InstanceTemplateInstanceByImageInstanceTemplateContext instanceTemplateInstanceByImageInstanceTemplateContextModel = new InstanceTemplateInstanceByImageInstanceTemplateContext(); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getAvailabilityPolicy()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getCreatedAt()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getCrn()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getDefaultTrustedProfile()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getHref()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getId()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getKeys()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getMetadataService()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getName()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getPlacementTarget()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getProfile()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getResourceGroup()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getTotalVolumeBandwidth()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getUserData()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getVolumeAttachments()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getVpc()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getBootVolumeAttachment()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getImage()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getNetworkInterfaces()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getPrimaryNetworkInterface()); - assertNull(instanceTemplateInstanceByImageInstanceTemplateContextModel.getZone()); + public void testInstanceTemplateInstanceByImage() throws Throwable { + InstanceTemplateInstanceByImage instanceTemplateInstanceByImageModel = new InstanceTemplateInstanceByImage(); + assertNull(instanceTemplateInstanceByImageModel.getAvailabilityPolicy()); + assertNull(instanceTemplateInstanceByImageModel.getCreatedAt()); + assertNull(instanceTemplateInstanceByImageModel.getCrn()); + assertNull(instanceTemplateInstanceByImageModel.getDefaultTrustedProfile()); + assertNull(instanceTemplateInstanceByImageModel.getHref()); + assertNull(instanceTemplateInstanceByImageModel.getId()); + assertNull(instanceTemplateInstanceByImageModel.getKeys()); + assertNull(instanceTemplateInstanceByImageModel.getMetadataService()); + assertNull(instanceTemplateInstanceByImageModel.getName()); + assertNull(instanceTemplateInstanceByImageModel.getPlacementTarget()); + assertNull(instanceTemplateInstanceByImageModel.getProfile()); + assertNull(instanceTemplateInstanceByImageModel.getResourceGroup()); + assertNull(instanceTemplateInstanceByImageModel.getTotalVolumeBandwidth()); + assertNull(instanceTemplateInstanceByImageModel.getUserData()); + assertNull(instanceTemplateInstanceByImageModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceByImageModel.getVpc()); + assertNull(instanceTemplateInstanceByImageModel.getBootVolumeAttachment()); + assertNull(instanceTemplateInstanceByImageModel.getImage()); + assertNull(instanceTemplateInstanceByImageModel.getNetworkInterfaces()); + assertNull(instanceTemplateInstanceByImageModel.getPrimaryNetworkInterface()); + assertNull(instanceTemplateInstanceByImageModel.getZone()); } } \ No newline at end of file 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/InstanceTemplateInstanceBySourceSnapshotTest.java similarity index 52% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotTest.java index cecca73d2b..e70852c7b4 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/InstanceTemplateInstanceBySourceSnapshotTest.java @@ -19,10 +19,11 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshot; 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; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; @@ -44,34 +45,34 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext model. + * Unit test class for the InstanceTemplateInstanceBySourceSnapshot model. */ -public class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextTest { +public class InstanceTemplateInstanceBySourceSnapshotTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() throws Throwable { - InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel = new InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getAvailabilityPolicy()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getCreatedAt()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getCrn()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getDefaultTrustedProfile()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getHref()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getId()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getKeys()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getMetadataService()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getName()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getPlacementTarget()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getProfile()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getResourceGroup()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getTotalVolumeBandwidth()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getUserData()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getVolumeAttachments()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getVpc()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getBootVolumeAttachment()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getNetworkInterfaces()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getPrimaryNetworkInterface()); - assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextModel.getZone()); + public void testInstanceTemplateInstanceBySourceSnapshot() throws Throwable { + InstanceTemplateInstanceBySourceSnapshot instanceTemplateInstanceBySourceSnapshotModel = new InstanceTemplateInstanceBySourceSnapshot(); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getAvailabilityPolicy()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getCreatedAt()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getCrn()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getDefaultTrustedProfile()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getHref()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getId()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getKeys()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getMetadataService()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getName()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getPlacementTarget()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getProfile()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getResourceGroup()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getTotalVolumeBandwidth()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getUserData()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getVpc()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getBootVolumeAttachment()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getNetworkInterfaces()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getPrimaryNetworkInterface()); + assertNull(instanceTemplateInstanceBySourceSnapshotModel.getZone()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingTest.java similarity index 67% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingTest.java index f0c5ead795..a788872fee 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingTest.java @@ -21,7 +21,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByCatalogOffering; 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; @@ -45,14 +45,14 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext model. + * Unit test class for the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering model. */ -public class InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextTest { +public class InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext() throws Throwable { + public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() throws Throwable { InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() .hostFailure("restart") .build(); @@ -134,6 +134,7 @@ public void testInstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTempla .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -141,6 +142,7 @@ public void testInstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTempla assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() @@ -199,7 +201,7 @@ public void testInstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTempla .build(); assertEquals(zoneIdentityModel.name(), "us-south-1"); - InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel = new InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.Builder() + InstanceTemplatePrototypeInstanceTemplateByCatalogOffering instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel = new InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.Builder() .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) .keys(java.util.Arrays.asList(keyIdentityModel)) @@ -218,47 +220,47 @@ public void testInstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTempla .primaryNetworkInterface(networkInterfacePrototypeModel) .zone(zoneIdentityModel) .build(); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.availabilityPolicy(), instanceAvailabilityPolicyPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.keys(), java.util.Arrays.asList(keyIdentityModel)); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.metadataService(), instanceMetadataServicePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.placementTarget(), instancePlacementTargetPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.profile(), instanceProfileIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.totalVolumeBandwidth(), Long.valueOf("500")); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.vpc(), vpcIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.primaryNetworkInterface(), networkInterfacePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel.zone(), zoneIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.availabilityPolicy(), instanceAvailabilityPolicyPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.keys(), java.util.Arrays.asList(keyIdentityModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.metadataService(), instanceMetadataServicePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.placementTarget(), instancePlacementTargetPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.profile(), instanceProfileIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.resourceGroup(), resourceGroupIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.vpc(), vpcIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.primaryNetworkInterface(), networkInterfacePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel.zone(), zoneIdentityModel); - String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModel); + String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModel); - InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.class); - assertTrue(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew instanceof InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.availabilityPolicy().toString(), instanceAvailabilityPolicyPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.profile().toString(), instanceProfileIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.totalVolumeBandwidth(), Long.valueOf("500")); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.vpc().toString(), vpcIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextModelNew.zone().toString(), zoneIdentityModel.toString()); + InstanceTemplatePrototypeInstanceTemplateByCatalogOffering instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.class); + assertTrue(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew instanceof InstanceTemplatePrototypeInstanceTemplateByCatalogOffering); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.availabilityPolicy().toString(), instanceAvailabilityPolicyPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.profile().toString(), instanceProfileIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.vpc().toString(), vpcIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingModelNew.zone().toString(), zoneIdentityModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testInstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContextError() throws Throwable { - new InstanceTemplatePrototypeInstanceByCatalogOfferingInstanceTemplateContext.Builder().build(); + public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingError() throws Throwable { + new InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageInstanceTemplateContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageTest.java similarity index 67% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageInstanceTemplateContextTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageTest.java index 724675892d..d99d0b73b2 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceByImageInstanceTemplateContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageTest.java @@ -20,7 +20,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImage; 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; @@ -44,14 +44,14 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext model. + * Unit test class for the InstanceTemplatePrototypeInstanceTemplateByImage model. */ -public class InstanceTemplatePrototypeInstanceByImageInstanceTemplateContextTest { +public class InstanceTemplatePrototypeInstanceTemplateByImageTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceTemplatePrototypeInstanceByImageInstanceTemplateContext() throws Throwable { + public void testInstanceTemplatePrototypeInstanceTemplateByImage() throws Throwable { InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() .hostFailure("restart") .build(); @@ -133,6 +133,7 @@ public void testInstanceTemplatePrototypeInstanceByImageInstanceTemplateContext( .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -140,6 +141,7 @@ public void testInstanceTemplatePrototypeInstanceByImageInstanceTemplateContext( assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() @@ -193,7 +195,7 @@ public void testInstanceTemplatePrototypeInstanceByImageInstanceTemplateContext( .build(); assertEquals(zoneIdentityModel.name(), "us-south-1"); - InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel = new InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.Builder() + InstanceTemplatePrototypeInstanceTemplateByImage instanceTemplatePrototypeInstanceTemplateByImageModel = new InstanceTemplatePrototypeInstanceTemplateByImage.Builder() .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) .keys(java.util.Arrays.asList(keyIdentityModel)) @@ -212,47 +214,47 @@ public void testInstanceTemplatePrototypeInstanceByImageInstanceTemplateContext( .primaryNetworkInterface(networkInterfacePrototypeModel) .zone(zoneIdentityModel) .build(); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.availabilityPolicy(), instanceAvailabilityPolicyPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.keys(), java.util.Arrays.asList(keyIdentityModel)); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.metadataService(), instanceMetadataServicePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.placementTarget(), instancePlacementTargetPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.profile(), instanceProfileIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.totalVolumeBandwidth(), Long.valueOf("500")); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.vpc(), vpcIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.image(), imageIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.primaryNetworkInterface(), networkInterfacePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel.zone(), zoneIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.availabilityPolicy(), instanceAvailabilityPolicyPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.keys(), java.util.Arrays.asList(keyIdentityModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.metadataService(), instanceMetadataServicePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.placementTarget(), instancePlacementTargetPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.profile(), instanceProfileIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.resourceGroup(), resourceGroupIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.vpc(), vpcIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.image(), imageIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.primaryNetworkInterface(), networkInterfacePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModel.zone(), zoneIdentityModel); - String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModel); + String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceTemplateByImageModel); - InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.class); - assertTrue(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew instanceof InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.availabilityPolicy().toString(), instanceAvailabilityPolicyPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.profile().toString(), instanceProfileIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.totalVolumeBandwidth(), Long.valueOf("500")); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.vpc().toString(), vpcIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.image().toString(), imageIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceByImageInstanceTemplateContextModelNew.zone().toString(), zoneIdentityModel.toString()); + InstanceTemplatePrototypeInstanceTemplateByImage instanceTemplatePrototypeInstanceTemplateByImageModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceTemplateByImage.class); + assertTrue(instanceTemplatePrototypeInstanceTemplateByImageModelNew instanceof InstanceTemplatePrototypeInstanceTemplateByImage); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.availabilityPolicy().toString(), instanceAvailabilityPolicyPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.profile().toString(), instanceProfileIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.vpc().toString(), vpcIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.image().toString(), imageIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageModelNew.zone().toString(), zoneIdentityModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testInstanceTemplatePrototypeInstanceByImageInstanceTemplateContextError() throws Throwable { - new InstanceTemplatePrototypeInstanceByImageInstanceTemplateContext.Builder().build(); + public void testInstanceTemplatePrototypeInstanceTemplateByImageError() throws Throwable { + new InstanceTemplatePrototypeInstanceTemplateByImage.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotTest.java similarity index 67% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotTest.java index 7b0640067d..e5f09aad89 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotTest.java @@ -19,7 +19,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot; 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; @@ -44,14 +44,14 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext model. + * Unit test class for the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot model. */ -public class InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextTest { +public class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext() throws Throwable { + public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() throws Throwable { InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() .hostFailure("restart") .build(); @@ -138,6 +138,7 @@ public void testInstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplat .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); @@ -146,6 +147,7 @@ public void testInstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplat assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.sourceSnapshot(), snapshotIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.userTags(), java.util.Arrays.asList("testString")); @@ -195,7 +197,7 @@ public void testInstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplat .build(); assertEquals(zoneIdentityModel.name(), "us-south-1"); - InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel = new InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.Builder() + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel = new InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.Builder() .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) .keys(java.util.Arrays.asList(keyIdentityModel)) @@ -213,45 +215,45 @@ public void testInstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplat .primaryNetworkInterface(networkInterfacePrototypeModel) .zone(zoneIdentityModel) .build(); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.availabilityPolicy(), instanceAvailabilityPolicyPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.keys(), java.util.Arrays.asList(keyIdentityModel)); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.metadataService(), instanceMetadataServicePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.placementTarget(), instancePlacementTargetPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.profile(), instanceProfileIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.totalVolumeBandwidth(), Long.valueOf("500")); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.vpc(), vpcIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.primaryNetworkInterface(), networkInterfacePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel.zone(), zoneIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.availabilityPolicy(), instanceAvailabilityPolicyPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.keys(), java.util.Arrays.asList(keyIdentityModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.metadataService(), instanceMetadataServicePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.placementTarget(), instancePlacementTargetPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.profile(), instanceProfileIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.vpc(), vpcIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.primaryNetworkInterface(), networkInterfacePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel.zone(), zoneIdentityModel); - String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModel); + String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModel); - InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.class); - assertTrue(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew instanceof InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.availabilityPolicy().toString(), instanceAvailabilityPolicyPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.profile().toString(), instanceProfileIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.totalVolumeBandwidth(), Long.valueOf("500")); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.vpc().toString(), vpcIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextModelNew.zone().toString(), zoneIdentityModel.toString()); + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.class); + assertTrue(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew instanceof InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.availabilityPolicy().toString(), instanceAvailabilityPolicyPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.profile().toString(), instanceProfileIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.vpc().toString(), vpcIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotModelNew.zone().toString(), zoneIdentityModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testInstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContextError() throws Throwable { - new InstanceTemplatePrototypeInstanceBySourceSnapshotInstanceTemplateContext.Builder().build(); + public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotError() throws Throwable { + new InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplateTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplateTest.java similarity index 68% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplateTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplateTest.java index 98c4f439b8..970a2ab35b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceBySourceTemplateTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplateTest.java @@ -23,7 +23,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityById; -import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceBySourceTemplate; +import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceTemplate; 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; @@ -47,14 +47,14 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceTemplatePrototypeInstanceBySourceTemplate model. + * Unit test class for the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate model. */ -public class InstanceTemplatePrototypeInstanceBySourceTemplateTest { +public class InstanceTemplatePrototypeInstanceTemplateBySourceTemplateTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throwable { + public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplate() throws Throwable { InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() .hostFailure("restart") .build(); @@ -136,6 +136,7 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -143,6 +144,7 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() @@ -211,7 +213,7 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw .build(); assertEquals(zoneIdentityModel.name(), "us-south-1"); - InstanceTemplatePrototypeInstanceBySourceTemplate instanceTemplatePrototypeInstanceBySourceTemplateModel = new InstanceTemplatePrototypeInstanceBySourceTemplate.Builder() + InstanceTemplatePrototypeInstanceTemplateBySourceTemplate instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel = new InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.Builder() .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) .keys(java.util.Arrays.asList(keyIdentityModel)) @@ -232,51 +234,51 @@ public void testInstanceTemplatePrototypeInstanceBySourceTemplate() throws Throw .sourceTemplate(instanceTemplateIdentityModel) .zone(zoneIdentityModel) .build(); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.availabilityPolicy(), instanceAvailabilityPolicyPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.keys(), java.util.Arrays.asList(keyIdentityModel)); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.metadataService(), instanceMetadataServicePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.placementTarget(), instancePlacementTargetPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.profile(), instanceProfileIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.resourceGroup(), resourceGroupIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.totalVolumeBandwidth(), Long.valueOf("500")); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.vpc(), vpcIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.image(), imageIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.primaryNetworkInterface(), networkInterfacePrototypeModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.sourceTemplate(), instanceTemplateIdentityModel); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModel.zone(), zoneIdentityModel); - - String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceBySourceTemplateModel); - - InstanceTemplatePrototypeInstanceBySourceTemplate instanceTemplatePrototypeInstanceBySourceTemplateModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceBySourceTemplate.class); - assertTrue(instanceTemplatePrototypeInstanceBySourceTemplateModelNew instanceof InstanceTemplatePrototypeInstanceBySourceTemplate); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.availabilityPolicy().toString(), instanceAvailabilityPolicyPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.name(), "my-instance"); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.profile().toString(), instanceProfileIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.totalVolumeBandwidth(), Long.valueOf("500")); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.userData(), "testString"); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.vpc().toString(), vpcIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.image().toString(), imageIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.sourceTemplate().toString(), instanceTemplateIdentityModel.toString()); - assertEquals(instanceTemplatePrototypeInstanceBySourceTemplateModelNew.zone().toString(), zoneIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.availabilityPolicy(), instanceAvailabilityPolicyPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.defaultTrustedProfile(), instanceDefaultTrustedProfilePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.keys(), java.util.Arrays.asList(keyIdentityModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.metadataService(), instanceMetadataServicePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.placementTarget(), instancePlacementTargetPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.profile(), instanceProfileIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.resourceGroup(), resourceGroupIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.vpc(), vpcIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.image(), imageIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.networkInterfaces(), java.util.Arrays.asList(networkInterfacePrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.primaryNetworkInterface(), networkInterfacePrototypeModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.sourceTemplate(), instanceTemplateIdentityModel); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.zone(), zoneIdentityModel); + + String json = TestUtilities.serialize(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel); + + InstanceTemplatePrototypeInstanceTemplateBySourceTemplate instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew = TestUtilities.deserialize(json, InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.class); + assertTrue(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew instanceof InstanceTemplatePrototypeInstanceTemplateBySourceTemplate); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.availabilityPolicy().toString(), instanceAvailabilityPolicyPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.defaultTrustedProfile().toString(), instanceDefaultTrustedProfilePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.metadataService().toString(), instanceMetadataServicePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.name(), "my-instance"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.placementTarget().toString(), instancePlacementTargetPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.profile().toString(), instanceProfileIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.vpc().toString(), vpcIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.image().toString(), imageIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.primaryNetworkInterface().toString(), networkInterfacePrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.sourceTemplate().toString(), instanceTemplateIdentityModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.zone().toString(), zoneIdentityModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testInstanceTemplatePrototypeInstanceBySourceTemplateError() throws Throwable { - new InstanceTemplatePrototypeInstanceBySourceTemplate.Builder().build(); + public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplateError() throws Throwable { + new InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.Builder().build(); } } \ No newline at end of file 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 5d33193a7f..f5156f57b8 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 @@ -24,6 +24,7 @@ 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; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; 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 ace1a09cfd..778593fa2b 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 @@ -13,12 +13,14 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.CatalogOfferingVersionReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostGroupReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReference; import com.ibm.cloud.is.vpc.v1.model.DedicatedHostReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.Instance; import com.ibm.cloud.is.vpc.v1.model.InstanceAvailabilityPolicy; import com.ibm.cloud.is.vpc.v1.model.InstanceCatalogOffering; @@ -32,6 +34,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReference; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.ReservedIPReference; import com.ibm.cloud.is.vpc.v1.model.ReservedIPReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyJobsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyJobsOptionsTest.java index 5f0c66a636..054c78ba0f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyJobsOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListBackupPolicyJobsOptionsTest.java @@ -33,24 +33,24 @@ public class ListBackupPolicyJobsOptionsTest { public void testListBackupPolicyJobsOptions() throws Throwable { ListBackupPolicyJobsOptions listBackupPolicyJobsOptionsModel = new ListBackupPolicyJobsOptions.Builder() .backupPolicyId("testString") - .status("testString") + .status("failed") .backupPolicyPlanId("testString") .start("testString") .limit(Long.valueOf("1")) .sort("name") .sourceId("testString") .targetSnapshotsId("testString") - .targetSnapshotsCrn("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); assertEquals(listBackupPolicyJobsOptionsModel.backupPolicyId(), "testString"); - assertEquals(listBackupPolicyJobsOptionsModel.status(), "testString"); + assertEquals(listBackupPolicyJobsOptionsModel.status(), "failed"); assertEquals(listBackupPolicyJobsOptionsModel.backupPolicyPlanId(), "testString"); assertEquals(listBackupPolicyJobsOptionsModel.start(), "testString"); assertEquals(listBackupPolicyJobsOptionsModel.limit(), Long.valueOf("1")); assertEquals(listBackupPolicyJobsOptionsModel.sort(), "name"); assertEquals(listBackupPolicyJobsOptionsModel.sourceId(), "testString"); assertEquals(listBackupPolicyJobsOptionsModel.targetSnapshotsId(), "testString"); - assertEquals(listBackupPolicyJobsOptionsModel.targetSnapshotsCrn(), "testString"); + assertEquals(listBackupPolicyJobsOptionsModel.targetSnapshotsCrn(), "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263"); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptionsTest.java index c9f1f45aa5..329277786b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListBareMetalServersOptionsTest.java @@ -37,21 +37,21 @@ public void testListBareMetalServersOptions() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .networkInterfacesSubnetId("testString") - .networkInterfacesSubnetCrn("testString") - .networkInterfacesSubnetName("testString") + .networkInterfacesSubnetCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .networkInterfacesSubnetName("my-subnet") .build(); assertEquals(listBareMetalServersOptionsModel.start(), "testString"); assertEquals(listBareMetalServersOptionsModel.limit(), Long.valueOf("1")); assertEquals(listBareMetalServersOptionsModel.resourceGroupId(), "testString"); assertEquals(listBareMetalServersOptionsModel.name(), "testString"); assertEquals(listBareMetalServersOptionsModel.vpcId(), "testString"); - assertEquals(listBareMetalServersOptionsModel.vpcCrn(), "testString"); - assertEquals(listBareMetalServersOptionsModel.vpcName(), "testString"); + assertEquals(listBareMetalServersOptionsModel.vpcCrn(), "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(listBareMetalServersOptionsModel.vpcName(), "my-vpc"); assertEquals(listBareMetalServersOptionsModel.networkInterfacesSubnetId(), "testString"); - assertEquals(listBareMetalServersOptionsModel.networkInterfacesSubnetCrn(), "testString"); - assertEquals(listBareMetalServersOptionsModel.networkInterfacesSubnetName(), "testString"); + assertEquals(listBareMetalServersOptionsModel.networkInterfacesSubnetCrn(), "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e"); + assertEquals(listBareMetalServersOptionsModel.networkInterfacesSubnetName(), "my-subnet"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptionsTest.java index d39532c85f..10bb8285d4 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostGroupsOptionsTest.java @@ -35,13 +35,13 @@ public void testListDedicatedHostGroupsOptions() throws Throwable { .start("testString") .limit(Long.valueOf("1")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); assertEquals(listDedicatedHostGroupsOptionsModel.start(), "testString"); assertEquals(listDedicatedHostGroupsOptionsModel.limit(), Long.valueOf("1")); assertEquals(listDedicatedHostGroupsOptionsModel.resourceGroupId(), "testString"); - assertEquals(listDedicatedHostGroupsOptionsModel.zoneName(), "testString"); + assertEquals(listDedicatedHostGroupsOptionsModel.zoneName(), "us-south-1"); assertEquals(listDedicatedHostGroupsOptionsModel.name(), "testString"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptionsTest.java index f55466dc1f..ebcf2551b2 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListDedicatedHostsOptionsTest.java @@ -36,14 +36,14 @@ public void testListDedicatedHostsOptions() throws Throwable { .start("testString") .limit(Long.valueOf("1")) .resourceGroupId("testString") - .zoneName("testString") + .zoneName("us-south-1") .name("testString") .build(); assertEquals(listDedicatedHostsOptionsModel.dedicatedHostGroupId(), "testString"); assertEquals(listDedicatedHostsOptionsModel.start(), "testString"); assertEquals(listDedicatedHostsOptionsModel.limit(), Long.valueOf("1")); assertEquals(listDedicatedHostsOptionsModel.resourceGroupId(), "testString"); - assertEquals(listDedicatedHostsOptionsModel.zoneName(), "testString"); + assertEquals(listDedicatedHostsOptionsModel.zoneName(), "us-south-1"); assertEquals(listDedicatedHostsOptionsModel.name(), "testString"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptionsTest.java index 257a459331..12f0ef805f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListFlowLogCollectorsOptionsTest.java @@ -37,19 +37,19 @@ public void testListFlowLogCollectorsOptions() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .targetId("testString") - .targetResourceType("instance") + .targetResourceType("testString") .build(); assertEquals(listFlowLogCollectorsOptionsModel.start(), "testString"); assertEquals(listFlowLogCollectorsOptionsModel.limit(), Long.valueOf("1")); assertEquals(listFlowLogCollectorsOptionsModel.resourceGroupId(), "testString"); assertEquals(listFlowLogCollectorsOptionsModel.name(), "testString"); assertEquals(listFlowLogCollectorsOptionsModel.vpcId(), "testString"); - assertEquals(listFlowLogCollectorsOptionsModel.vpcCrn(), "testString"); - assertEquals(listFlowLogCollectorsOptionsModel.vpcName(), "testString"); + assertEquals(listFlowLogCollectorsOptionsModel.vpcCrn(), "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(listFlowLogCollectorsOptionsModel.vpcName(), "my-vpc"); assertEquals(listFlowLogCollectorsOptionsModel.targetId(), "testString"); - assertEquals(listFlowLogCollectorsOptionsModel.targetResourceType(), "instance"); + assertEquals(listFlowLogCollectorsOptionsModel.targetResourceType(), "testString"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptionsTest.java index 6a044701c4..ab43549961 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImagesOptionsTest.java @@ -36,12 +36,14 @@ public void testListImagesOptions() throws Throwable { .limit(Long.valueOf("1")) .resourceGroupId("testString") .name("testString") + .status(java.util.Arrays.asList("available")) .visibility("private") .build(); assertEquals(listImagesOptionsModel.start(), "testString"); assertEquals(listImagesOptionsModel.limit(), Long.valueOf("1")); assertEquals(listImagesOptionsModel.resourceGroupId(), "testString"); assertEquals(listImagesOptionsModel.name(), "testString"); + assertEquals(listImagesOptionsModel.status(), java.util.Arrays.asList("available")); assertEquals(listImagesOptionsModel.visibility(), "private"); } } \ 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 99deb07627..66c2bbe72e 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 @@ -37,27 +37,27 @@ public void testListInstancesOptions() throws Throwable { .resourceGroupId("testString") .name("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .dedicatedHostId("testString") - .dedicatedHostCrn("testString") - .dedicatedHostName("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") .placementGroupId("testString") - .placementGroupCrn("testString") - .placementGroupName("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") .build(); assertEquals(listInstancesOptionsModel.start(), "testString"); assertEquals(listInstancesOptionsModel.limit(), Long.valueOf("1")); assertEquals(listInstancesOptionsModel.resourceGroupId(), "testString"); assertEquals(listInstancesOptionsModel.name(), "testString"); assertEquals(listInstancesOptionsModel.vpcId(), "testString"); - assertEquals(listInstancesOptionsModel.vpcCrn(), "testString"); - assertEquals(listInstancesOptionsModel.vpcName(), "testString"); + assertEquals(listInstancesOptionsModel.vpcCrn(), "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(listInstancesOptionsModel.vpcName(), "my-vpc"); assertEquals(listInstancesOptionsModel.dedicatedHostId(), "testString"); - assertEquals(listInstancesOptionsModel.dedicatedHostCrn(), "testString"); - assertEquals(listInstancesOptionsModel.dedicatedHostName(), "testString"); + assertEquals(listInstancesOptionsModel.dedicatedHostCrn(), "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a"); + assertEquals(listInstancesOptionsModel.dedicatedHostName(), "my-dedicated-host"); assertEquals(listInstancesOptionsModel.placementGroupId(), "testString"); - assertEquals(listInstancesOptionsModel.placementGroupCrn(), "testString"); - assertEquals(listInstancesOptionsModel.placementGroupName(), "testString"); + assertEquals(listInstancesOptionsModel.placementGroupCrn(), "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871"); + assertEquals(listInstancesOptionsModel.placementGroupName(), "my-placement-group"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptionsTest.java index 6980dec22a..ef01914e90 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSecurityGroupsOptionsTest.java @@ -36,14 +36,14 @@ public void testListSecurityGroupsOptions() throws Throwable { .limit(Long.valueOf("1")) .resourceGroupId("testString") .vpcId("testString") - .vpcCrn("testString") - .vpcName("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); assertEquals(listSecurityGroupsOptionsModel.start(), "testString"); assertEquals(listSecurityGroupsOptionsModel.limit(), Long.valueOf("1")); assertEquals(listSecurityGroupsOptionsModel.resourceGroupId(), "testString"); assertEquals(listSecurityGroupsOptionsModel.vpcId(), "testString"); - assertEquals(listSecurityGroupsOptionsModel.vpcCrn(), "testString"); - assertEquals(listSecurityGroupsOptionsModel.vpcName(), "testString"); + assertEquals(listSecurityGroupsOptionsModel.vpcCrn(), "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(listSecurityGroupsOptionsModel.vpcName(), "my-vpc"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptionsTest.java index 2dd3aa0e6d..041191ad72 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotsOptionsTest.java @@ -38,12 +38,20 @@ public void testListSnapshotsOptions() throws Throwable { .resourceGroupId("testString") .name("testString") .sourceVolumeId("testString") - .sourceVolumeCrn("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .sourceImageId("testString") - .sourceImageCrn("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .sort("name") .backupPolicyPlanId("testString") - .clonesZoneName("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("testString") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-south") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") .build(); assertEquals(listSnapshotsOptionsModel.start(), "testString"); assertEquals(listSnapshotsOptionsModel.limit(), Long.valueOf("1")); @@ -51,11 +59,19 @@ public void testListSnapshotsOptions() throws Throwable { assertEquals(listSnapshotsOptionsModel.resourceGroupId(), "testString"); assertEquals(listSnapshotsOptionsModel.name(), "testString"); assertEquals(listSnapshotsOptionsModel.sourceVolumeId(), "testString"); - assertEquals(listSnapshotsOptionsModel.sourceVolumeCrn(), "testString"); + assertEquals(listSnapshotsOptionsModel.sourceVolumeCrn(), "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); assertEquals(listSnapshotsOptionsModel.sourceImageId(), "testString"); - assertEquals(listSnapshotsOptionsModel.sourceImageCrn(), "testString"); + assertEquals(listSnapshotsOptionsModel.sourceImageCrn(), "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"); assertEquals(listSnapshotsOptionsModel.sort(), "name"); assertEquals(listSnapshotsOptionsModel.backupPolicyPlanId(), "testString"); - assertEquals(listSnapshotsOptionsModel.clonesZoneName(), "testString"); + assertEquals(listSnapshotsOptionsModel.copiesId(), "testString"); + assertEquals(listSnapshotsOptionsModel.copiesName(), "my-snapshot-copy"); + assertEquals(listSnapshotsOptionsModel.copiesCrn(), "testString"); + assertEquals(listSnapshotsOptionsModel.copiesRemoteRegionName(), "us-south"); + assertEquals(listSnapshotsOptionsModel.sourceSnapshotId(), "testString"); + assertEquals(listSnapshotsOptionsModel.sourceSnapshotRemoteRegionName(), "us-south"); + assertEquals(listSnapshotsOptionsModel.sourceVolumeRemoteRegionName(), "us-south"); + assertEquals(listSnapshotsOptionsModel.sourceImageRemoteRegionName(), "us-south"); + assertEquals(listSnapshotsOptionsModel.clonesZoneName(), "us-south-1"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptionsTest.java index 9ca4742fe0..cb3fc55962 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSubnetsOptionsTest.java @@ -36,12 +36,12 @@ public void testListSubnetsOptions() throws Throwable { .limit(Long.valueOf("1")) .resourceGroupId("testString") .routingTableId("testString") - .routingTableName("testString") + .routingTableName("my-routing-table") .build(); assertEquals(listSubnetsOptionsModel.start(), "testString"); assertEquals(listSubnetsOptionsModel.limit(), Long.valueOf("1")); assertEquals(listSubnetsOptionsModel.resourceGroupId(), "testString"); assertEquals(listSubnetsOptionsModel.routingTableId(), "testString"); - assertEquals(listSubnetsOptionsModel.routingTableName(), "testString"); + assertEquals(listSubnetsOptionsModel.routingTableName(), "my-routing-table"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptionsTest.java index 9fb848a55d..e8ab04225a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVolumesOptionsTest.java @@ -39,7 +39,7 @@ public void testListVolumesOptions() throws Throwable { .encryption("provider_managed") .operatingSystemFamily("Ubuntu Server") .operatingSystemArchitecture("amd64") - .zoneName("testString") + .zoneName("us-south-1") .build(); assertEquals(listVolumesOptionsModel.start(), "testString"); assertEquals(listVolumesOptionsModel.limit(), Long.valueOf("1")); @@ -48,6 +48,6 @@ public void testListVolumesOptions() throws Throwable { assertEquals(listVolumesOptionsModel.encryption(), "provider_managed"); assertEquals(listVolumesOptionsModel.operatingSystemFamily(), "Ubuntu Server"); assertEquals(listVolumesOptionsModel.operatingSystemArchitecture(), "amd64"); - assertEquals(listVolumesOptionsModel.zoneName(), "testString"); + assertEquals(listVolumesOptionsModel.zoneName(), "us-south-1"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptionsTest.java index 9f047179d2..52502902fc 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpcRoutesOptionsTest.java @@ -33,12 +33,12 @@ public class ListVpcRoutesOptionsTest { public void testListVpcRoutesOptions() throws Throwable { ListVpcRoutesOptions listVpcRoutesOptionsModel = new ListVpcRoutesOptions.Builder() .vpcId("testString") - .zoneName("testString") + .zoneName("us-south-1") .start("testString") .limit(Long.valueOf("1")) .build(); assertEquals(listVpcRoutesOptionsModel.vpcId(), "testString"); - assertEquals(listVpcRoutesOptionsModel.zoneName(), "testString"); + assertEquals(listVpcRoutesOptionsModel.zoneName(), "us-south-1"); assertEquals(listVpcRoutesOptionsModel.start(), "testString"); assertEquals(listVpcRoutesOptionsModel.limit(), Long.valueOf("1")); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptionsTest.java index 859e40d7ea..6332cc53b1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayConnectionsOptionsTest.java @@ -33,10 +33,10 @@ public class ListVpnGatewayConnectionsOptionsTest { public void testListVpnGatewayConnectionsOptions() throws Throwable { ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptionsModel = new ListVpnGatewayConnectionsOptions.Builder() .vpnGatewayId("testString") - .status("testString") + .status("down") .build(); assertEquals(listVpnGatewayConnectionsOptionsModel.vpnGatewayId(), "testString"); - assertEquals(listVpnGatewayConnectionsOptionsModel.status(), "testString"); + assertEquals(listVpnGatewayConnectionsOptionsModel.status(), "down"); } @Test(expectedExceptions = IllegalArgumentException.class) 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 c83b2da1c5..da4b888103 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 @@ -17,6 +17,7 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileCollection; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileInstanceGroupsSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileLoggingSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileRouteModeSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSecurityGroupsSupportedFixed; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedDependentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedDependentTest.java new file mode 100644 index 0000000000..7fe97ba366 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedDependentTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.LoadBalancerProfileInstanceGroupsSupportedDependent; +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 LoadBalancerProfileInstanceGroupsSupportedDependent model. + */ +public class LoadBalancerProfileInstanceGroupsSupportedDependentTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLoadBalancerProfileInstanceGroupsSupportedDependent() throws Throwable { + LoadBalancerProfileInstanceGroupsSupportedDependent loadBalancerProfileInstanceGroupsSupportedDependentModel = new LoadBalancerProfileInstanceGroupsSupportedDependent(); + assertNull(loadBalancerProfileInstanceGroupsSupportedDependentModel.getType()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedFixedTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedFixedTest.java new file mode 100644 index 0000000000..c5ff90e3a6 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedFixedTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.LoadBalancerProfileInstanceGroupsSupportedFixed; +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 LoadBalancerProfileInstanceGroupsSupportedFixed model. + */ +public class LoadBalancerProfileInstanceGroupsSupportedFixedTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLoadBalancerProfileInstanceGroupsSupportedFixed() throws Throwable { + LoadBalancerProfileInstanceGroupsSupportedFixed loadBalancerProfileInstanceGroupsSupportedFixedModel = new LoadBalancerProfileInstanceGroupsSupportedFixed(); + assertNull(loadBalancerProfileInstanceGroupsSupportedFixedModel.getType()); + assertNull(loadBalancerProfileInstanceGroupsSupportedFixedModel.isValue()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedTest.java new file mode 100644 index 0000000000..6d73d08365 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileInstanceGroupsSupportedTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.LoadBalancerProfileInstanceGroupsSupported; +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 LoadBalancerProfileInstanceGroupsSupported model. + */ +public class LoadBalancerProfileInstanceGroupsSupportedTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testLoadBalancerProfileInstanceGroupsSupported() throws Throwable { + LoadBalancerProfileInstanceGroupsSupported loadBalancerProfileInstanceGroupsSupportedModel = new LoadBalancerProfileInstanceGroupsSupported(); + assertNotNull(loadBalancerProfileInstanceGroupsSupportedModel); + } +} \ 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 88f91ac563..d1722a52e6 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 @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfile; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileInstanceGroupsSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileLoggingSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileRouteModeSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSecurityGroupsSupportedFixed; @@ -38,6 +39,7 @@ public void testLoadBalancerProfile() throws Throwable { LoadBalancerProfile loadBalancerProfileModel = new LoadBalancerProfile(); assertNull(loadBalancerProfileModel.getFamily()); assertNull(loadBalancerProfileModel.getHref()); + assertNull(loadBalancerProfileModel.getInstanceGroupsSupported()); assertNull(loadBalancerProfileModel.getLoggingSupported()); assertNull(loadBalancerProfileModel.getName()); assertNull(loadBalancerProfileModel.getRouteModeSupported()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerTest.java index af6eed054e..fc52e51604 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerTest.java @@ -56,6 +56,7 @@ public void testLoadBalancer() throws Throwable { assertNull(loadBalancerModel.getHostname()); assertNull(loadBalancerModel.getHref()); assertNull(loadBalancerModel.getId()); + assertNull(loadBalancerModel.isInstanceGroupsSupported()); assertNull(loadBalancerModel.isIsPublic()); assertNull(loadBalancerModel.getListeners()); assertNull(loadBalancerModel.getLogging()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionTest.java index 42528b5ec7..ba35da2d56 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/OperatingSystemCollectionTest.java @@ -39,5 +39,6 @@ public void testOperatingSystemCollection() throws Throwable { assertNull(operatingSystemCollectionModel.getLimit()); assertNull(operatingSystemCollectionModel.getNext()); assertNull(operatingSystemCollectionModel.getOperatingSystems()); + assertNull(operatingSystemCollectionModel.getTotalCount()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByHrefTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByHrefTest.java new file mode 100644 index 0000000000..47e462b6c8 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByHrefTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RegionIdentityByHref; +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 RegionIdentityByHref model. + */ +public class RegionIdentityByHrefTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRegionIdentityByHref() throws Throwable { + RegionIdentityByHref regionIdentityByHrefModel = new RegionIdentityByHref.Builder() + .href("https://us-south.iaas.cloud.ibm.com/v1/regions/us-south") + .build(); + assertEquals(regionIdentityByHrefModel.href(), "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south"); + + String json = TestUtilities.serialize(regionIdentityByHrefModel); + + RegionIdentityByHref regionIdentityByHrefModelNew = TestUtilities.deserialize(json, RegionIdentityByHref.class); + assertTrue(regionIdentityByHrefModelNew instanceof RegionIdentityByHref); + assertEquals(regionIdentityByHrefModelNew.href(), "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testRegionIdentityByHrefError() throws Throwable { + new RegionIdentityByHref.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByNameTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByNameTest.java new file mode 100644 index 0000000000..3af38d0e73 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityByNameTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RegionIdentityByName; +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 RegionIdentityByName model. + */ +public class RegionIdentityByNameTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRegionIdentityByName() throws Throwable { + RegionIdentityByName regionIdentityByNameModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + assertEquals(regionIdentityByNameModel.name(), "us-south"); + + String json = TestUtilities.serialize(regionIdentityByNameModel); + + RegionIdentityByName regionIdentityByNameModelNew = TestUtilities.deserialize(json, RegionIdentityByName.class); + assertTrue(regionIdentityByNameModelNew instanceof RegionIdentityByName); + assertEquals(regionIdentityByNameModelNew.name(), "us-south"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testRegionIdentityByNameError() throws Throwable { + new RegionIdentityByName.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityTest.java new file mode 100644 index 0000000000..3c12f812c4 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RegionIdentityTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RegionIdentity; +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 RegionIdentity model. + */ +public class RegionIdentityTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testRegionIdentity() throws Throwable { + RegionIdentity regionIdentityModel = new RegionIdentity(); + assertNotNull(regionIdentityModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextFirstTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextFirstTest.java new file mode 100644 index 0000000000..28582469d6 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextFirstTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RouteCollectionVPCContextFirst; +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 RouteCollectionVPCContextFirst model. + */ +public class RouteCollectionVPCContextFirstTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRouteCollectionVPCContextFirst() throws Throwable { + RouteCollectionVPCContextFirst routeCollectionVpcContextFirstModel = new RouteCollectionVPCContextFirst(); + assertNull(routeCollectionVpcContextFirstModel.getHref()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextNextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextNextTest.java new file mode 100644 index 0000000000..075ffd625e --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextNextTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RouteCollectionVPCContextNext; +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 RouteCollectionVPCContextNext model. + */ +public class RouteCollectionVPCContextNextTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRouteCollectionVPCContextNext() throws Throwable { + RouteCollectionVPCContextNext routeCollectionVpcContextNextModel = new RouteCollectionVPCContextNext(); + assertNull(routeCollectionVpcContextNextModel.getHref()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextRoutesItemTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextRoutesItemTest.java new file mode 100644 index 0000000000..f72041b003 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextRoutesItemTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RouteCollectionVPCContextRoutesItem; +import com.ibm.cloud.is.vpc.v1.model.RouteNextHopIP; +import com.ibm.cloud.is.vpc.v1.model.ZoneReference; +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 RouteCollectionVPCContextRoutesItem model. + */ +public class RouteCollectionVPCContextRoutesItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRouteCollectionVPCContextRoutesItem() throws Throwable { + RouteCollectionVPCContextRoutesItem routeCollectionVpcContextRoutesItemModel = new RouteCollectionVPCContextRoutesItem(); + assertNull(routeCollectionVpcContextRoutesItemModel.getAction()); + assertNull(routeCollectionVpcContextRoutesItemModel.getCreatedAt()); + assertNull(routeCollectionVpcContextRoutesItemModel.getDestination()); + assertNull(routeCollectionVpcContextRoutesItemModel.getHref()); + assertNull(routeCollectionVpcContextRoutesItemModel.getId()); + assertNull(routeCollectionVpcContextRoutesItemModel.getLifecycleState()); + assertNull(routeCollectionVpcContextRoutesItemModel.getName()); + assertNull(routeCollectionVpcContextRoutesItemModel.getNextHop()); + assertNull(routeCollectionVpcContextRoutesItemModel.getPriority()); + assertNull(routeCollectionVpcContextRoutesItemModel.getZone()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextTest.java new file mode 100644 index 0000000000..fb2f726be8 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RouteCollectionVPCContextTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RouteCollectionVPCContext; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextFirst; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextNext; +import com.ibm.cloud.is.vpc.v1.model.RouteCollectionVPCContextRoutesItem; +import com.ibm.cloud.is.vpc.v1.model.RouteNextHopIP; +import com.ibm.cloud.is.vpc.v1.model.ZoneReference; +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 RouteCollectionVPCContext model. + */ +public class RouteCollectionVPCContextTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRouteCollectionVPCContext() throws Throwable { + RouteCollectionVPCContext routeCollectionVpcContextModel = new RouteCollectionVPCContext(); + assertNull(routeCollectionVpcContextModel.getFirst()); + assertNull(routeCollectionVpcContextModel.getLimit()); + assertNull(routeCollectionVpcContextModel.getNext()); + assertNull(routeCollectionVpcContextModel.getRoutes()); + assertNull(routeCollectionVpcContextModel.getTotalCount()); + } +} \ 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 5b43c96afc..758a9b3110 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 @@ -13,20 +13,29 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; +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.SnapshotClone; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollection; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollectionFirst; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollectionNext; +import com.ibm.cloud.is.vpc.v1.model.SnapshotCopiesItem; +import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; +import com.ibm.cloud.is.vpc.v1.model.SnapshotSourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.VolumeReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; import com.ibm.cloud.is.vpc.v1.model.ZoneReference; 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/SnapshotCopiesItemTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCopiesItemTest.java new file mode 100644 index 0000000000..ac219ca021 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCopiesItemTest.java @@ -0,0 +1,46 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RegionReference; +import com.ibm.cloud.is.vpc.v1.model.SnapshotCopiesItem; +import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; +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 SnapshotCopiesItem model. + */ +public class SnapshotCopiesItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSnapshotCopiesItem() throws Throwable { + SnapshotCopiesItem snapshotCopiesItemModel = new SnapshotCopiesItem(); + assertNull(snapshotCopiesItemModel.getCrn()); + assertNull(snapshotCopiesItemModel.getDeleted()); + assertNull(snapshotCopiesItemModel.getHref()); + assertNull(snapshotCopiesItemModel.getId()); + assertNull(snapshotCopiesItemModel.getName()); + assertNull(snapshotCopiesItemModel.getRemote()); + assertNull(snapshotCopiesItemModel.getResourceType()); + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..06a687c1bf --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshotTest.java @@ -0,0 +1,94 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +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; +import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; +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 SnapshotPrototypeSnapshotBySourceSnapshot model. + */ +public class SnapshotPrototypeSnapshotBySourceSnapshotTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSnapshotPrototypeSnapshotBySourceSnapshot() throws Throwable { + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + assertEquals(zoneIdentityModel.name(), "us-south-1"); + + SnapshotClonePrototype snapshotClonePrototypeModel = new SnapshotClonePrototype.Builder() + .zone(zoneIdentityModel) + .build(); + assertEquals(snapshotClonePrototypeModel.zone(), zoneIdentityModel); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + assertEquals(encryptionKeyIdentityModel.crn(), "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"); + + SnapshotIdentityByCRN snapshotIdentityByCrnModel = new SnapshotIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263") + .build(); + assertEquals(snapshotIdentityByCrnModel.crn(), "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263"); + + SnapshotPrototypeSnapshotBySourceSnapshot snapshotPrototypeSnapshotBySourceSnapshotModel = new SnapshotPrototypeSnapshotBySourceSnapshot.Builder() + .clones(java.util.Arrays.asList(snapshotClonePrototypeModel)) + .name("my-snapshot") + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .encryptionKey(encryptionKeyIdentityModel) + .sourceSnapshot(snapshotIdentityByCrnModel) + .build(); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.clones(), java.util.Arrays.asList(snapshotClonePrototypeModel)); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.name(), "my-snapshot"); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.userTags(), java.util.Arrays.asList("testString")); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.encryptionKey(), encryptionKeyIdentityModel); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.sourceSnapshot(), snapshotIdentityByCrnModel); + + String json = TestUtilities.serialize(snapshotPrototypeSnapshotBySourceSnapshotModel); + + SnapshotPrototypeSnapshotBySourceSnapshot snapshotPrototypeSnapshotBySourceSnapshotModelNew = TestUtilities.deserialize(json, SnapshotPrototypeSnapshotBySourceSnapshot.class); + assertTrue(snapshotPrototypeSnapshotBySourceSnapshotModelNew instanceof SnapshotPrototypeSnapshotBySourceSnapshot); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModelNew.name(), "my-snapshot"); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModelNew.sourceSnapshot().toString(), snapshotIdentityByCrnModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testSnapshotPrototypeSnapshotBySourceSnapshotError() throws Throwable { + new SnapshotPrototypeSnapshotBySourceSnapshot.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReferenceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReferenceTest.java index 58b9de0a46..1bef0d28d8 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReferenceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotReferenceTest.java @@ -13,8 +13,10 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -38,6 +40,7 @@ public void testSnapshotReference() throws Throwable { assertNull(snapshotReferenceModel.getHref()); assertNull(snapshotReferenceModel.getId()); assertNull(snapshotReferenceModel.getName()); + assertNull(snapshotReferenceModel.getRemote()); assertNull(snapshotReferenceModel.getResourceType()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotRemoteTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotRemoteTest.java new file mode 100644 index 0000000000..077e09a1e9 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotRemoteTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RegionReference; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; +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 SnapshotRemote model. + */ +public class SnapshotRemoteTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSnapshotRemote() throws Throwable { + SnapshotRemote snapshotRemoteModel = new SnapshotRemote(); + assertNull(snapshotRemoteModel.getRegion()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotSourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotSourceSnapshotTest.java new file mode 100644 index 0000000000..61390bd065 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotSourceSnapshotTest.java @@ -0,0 +1,46 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RegionReference; +import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; +import com.ibm.cloud.is.vpc.v1.model.SnapshotSourceSnapshot; +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 SnapshotSourceSnapshot model. + */ +public class SnapshotSourceSnapshotTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSnapshotSourceSnapshot() throws Throwable { + SnapshotSourceSnapshot snapshotSourceSnapshotModel = new SnapshotSourceSnapshot(); + assertNull(snapshotSourceSnapshotModel.getCrn()); + assertNull(snapshotSourceSnapshotModel.getDeleted()); + assertNull(snapshotSourceSnapshotModel.getHref()); + assertNull(snapshotSourceSnapshotModel.getId()); + assertNull(snapshotSourceSnapshotModel.getName()); + assertNull(snapshotSourceSnapshotModel.getRemote()); + assertNull(snapshotSourceSnapshotModel.getResourceType()); + } +} \ No newline at end of file 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 304310f6b0..fa6189bb28 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 @@ -13,17 +13,26 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReference; import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.BackupPolicyPlanRemote; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; +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.SnapshotClone; +import com.ibm.cloud.is.vpc.v1.model.SnapshotCopiesItem; +import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; +import com.ibm.cloud.is.vpc.v1.model.SnapshotSourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.VolumeReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; import com.ibm.cloud.is.vpc.v1.model.ZoneReference; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -48,6 +57,7 @@ public void testSnapshot() throws Throwable { assertNull(snapshotModel.isBootable()); assertNull(snapshotModel.getCapturedAt()); assertNull(snapshotModel.getClones()); + assertNull(snapshotModel.getCopies()); assertNull(snapshotModel.getCreatedAt()); assertNull(snapshotModel.getCrn()); assertNull(snapshotModel.isDeletable()); @@ -64,6 +74,7 @@ public void testSnapshot() throws Throwable { assertNull(snapshotModel.getServiceTags()); assertNull(snapshotModel.getSize()); assertNull(snapshotModel.getSourceImage()); + assertNull(snapshotModel.getSourceSnapshot()); assertNull(snapshotModel.getSourceVolume()); assertNull(snapshotModel.getUserTags()); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteResponseTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteResponseTest.java new file mode 100644 index 0000000000..31f27ef2ba --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpcRouteResponseTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RouteNextHopIP; +import com.ibm.cloud.is.vpc.v1.model.UpdateVpcRouteResponse; +import com.ibm.cloud.is.vpc.v1.model.ZoneReference; +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 UpdateVpcRouteResponse model. + */ +public class UpdateVpcRouteResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateVpcRouteResponse() throws Throwable { + UpdateVpcRouteResponse updateVpcRouteResponseModel = new UpdateVpcRouteResponse(); + assertNull(updateVpcRouteResponseModel.getAction()); + assertNull(updateVpcRouteResponseModel.getCreatedAt()); + assertNull(updateVpcRouteResponseModel.getDestination()); + assertNull(updateVpcRouteResponseModel.getHref()); + assertNull(updateVpcRouteResponseModel.getId()); + assertNull(updateVpcRouteResponseModel.getLifecycleState()); + assertNull(updateVpcRouteResponseModel.getName()); + assertNull(updateVpcRouteResponseModel.getNextHop()); + assertNull(updateVpcRouteResponseModel.getPriority()); + assertNull(updateVpcRouteResponseModel.getZone()); + } +} \ 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 bdc78fcb7b..aa9d9fdee8 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 @@ -14,6 +14,8 @@ 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.ReservedIPReference; +import com.ibm.cloud.is.vpc.v1.model.ReservedIPReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMemberTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMemberTest.java index 3da67cea64..98c30efafb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMemberTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayMemberTest.java @@ -14,6 +14,8 @@ 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.ReservedIPReference; +import com.ibm.cloud.is.vpc.v1.model.ReservedIPReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayMember; 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/VPNGatewayPolicyModeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyModeTest.java index b829554a49..1b0d192b00 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyModeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPolicyModeTest.java @@ -14,6 +14,8 @@ 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.ReservedIPReference; +import com.ibm.cloud.is.vpc.v1.model.ReservedIPReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; 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 cfd8df3218..6ede63fadb 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 @@ -14,6 +14,8 @@ 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.ReservedIPReference; +import com.ibm.cloud.is.vpc.v1.model.ReservedIPReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayTest.java index dd7ac81dc3..87297e369e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayTest.java @@ -14,6 +14,8 @@ 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.ReservedIPReference; +import com.ibm.cloud.is.vpc.v1.model.ReservedIPReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReferenceDeleted; 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 8d9d6cabcc..648f157f04 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 @@ -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.ResourceGroupIdentityById; 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; @@ -44,12 +45,18 @@ public void testVolumeAttachmentPrototypeInstanceByImageContext() throws Throwab .build(); assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -57,6 +64,7 @@ public void testVolumeAttachmentPrototypeInstanceByImageContext() throws Throwab assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() 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 c0dcbfe546..e96a87be93 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 @@ -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.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; @@ -45,6 +46,11 @@ public void testVolumeAttachmentPrototypeInstanceBySourceSnapshotContext() throw .build(); assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + SnapshotIdentityById snapshotIdentityModel = new SnapshotIdentityById.Builder() .id("349a61d8-7ab1-420f-a690-5fed76ef9d4f") .build(); @@ -56,6 +62,7 @@ public void testVolumeAttachmentPrototypeInstanceBySourceSnapshotContext() throw .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); @@ -64,6 +71,7 @@ public void testVolumeAttachmentPrototypeInstanceBySourceSnapshotContext() throw assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.sourceSnapshot(), snapshotIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.userTags(), java.util.Arrays.asList("testString")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextTest.java index 43a688c472..59853b95a3 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextTest.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.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java index 48b9601b2f..880a8df328 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityTest.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.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -38,6 +39,11 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol .build(); assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -47,6 +53,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -54,6 +61,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.iops(), Long.valueOf("10000")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.name(), "my-volume"); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.profile(), volumeProfileIdentityModel); + assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel.encryptionKey(), encryptionKeyIdentityModel); @@ -65,6 +73,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModelNew.iops(), Long.valueOf("10000")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModelNew.name(), "my-volume"); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModelNew.profile().toString(), volumeProfileIdentityModel.toString()); + assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModelNew.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); } 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 3b5fe6c572..579b7bdb58 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 @@ -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.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; @@ -39,6 +40,11 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol .build(); assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -53,6 +59,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -61,6 +68,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.iops(), Long.valueOf("10000")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.name(), "my-volume"); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.profile(), volumeProfileIdentityModel); + assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.userTags(), java.util.Arrays.asList("testString")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.encryptionKey(), encryptionKeyIdentityModel); @@ -73,6 +81,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.iops(), Long.valueOf("10000")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.name(), "my-volume"); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.profile().toString(), volumeProfileIdentityModel.toString()); + assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.resourceGroup().toString(), resourceGroupIdentityModel.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 eefe981920..44bd423287 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 @@ -13,15 +13,19 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.InstanceReference; import com.ibm.cloud.is.vpc.v1.model.InstanceReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; +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.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +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.VolumeAttachmentDevice; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentReferenceVolumeContext; @@ -55,6 +59,7 @@ public void testVolumeCollection() throws Throwable { assertNull(volumeCollectionModel.getFirst()); assertNull(volumeCollectionModel.getLimit()); assertNull(volumeCollectionModel.getNext()); + assertNull(volumeCollectionModel.getTotalCount()); assertNull(volumeCollectionModel.getVolumes()); } } \ No newline at end of file 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 0d16c7487c..2b9b35e33d 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 @@ -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.ResourceGroupIdentityById; 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; @@ -43,12 +44,18 @@ public void testVolumePrototypeInstanceByImageContext() throws Throwable { .build(); assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); @@ -56,6 +63,7 @@ public void testVolumePrototypeInstanceByImageContext() throws Throwable { assertEquals(volumePrototypeInstanceByImageContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceByImageContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceByImageContextModel.userTags(), java.util.Arrays.asList("testString")); String json = TestUtilities.serialize(volumePrototypeInstanceByImageContextModel); @@ -67,6 +75,7 @@ public void testVolumePrototypeInstanceByImageContext() throws Throwable { assertEquals(volumePrototypeInstanceByImageContextModelNew.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceByImageContextModelNew.name(), "my-volume"); assertEquals(volumePrototypeInstanceByImageContextModelNew.profile().toString(), volumeProfileIdentityModel.toString()); + assertEquals(volumePrototypeInstanceByImageContextModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) 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 8ca3fcb120..eb4566825b 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 @@ -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.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceBySourceSnapshotContext; @@ -44,6 +45,11 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl .build(); assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + SnapshotIdentityById snapshotIdentityModel = new SnapshotIdentityById.Builder() .id("349a61d8-7ab1-420f-a690-5fed76ef9d4f") .build(); @@ -55,6 +61,7 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl .iops(Long.valueOf("10000")) .name("my-volume") .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); @@ -63,6 +70,7 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.name(), "my-volume"); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.profile(), volumeProfileIdentityModel); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.sourceSnapshot(), snapshotIdentityModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.userTags(), java.util.Arrays.asList("testString")); @@ -75,6 +83,7 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.iops(), Long.valueOf("10000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.name(), "my-volume"); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.profile().toString(), volumeProfileIdentityModel.toString()); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.sourceSnapshot().toString(), snapshotIdentityModel.toString()); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupResourceGroupIdentityByIdTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupResourceGroupIdentityByIdTest.java new file mode 100644 index 0000000000..7b8bbe5ed4 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupResourceGroupIdentityByIdTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.VolumePrototypeResourceGroupResourceGroupIdentityById; +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 VolumePrototypeResourceGroupResourceGroupIdentityById model. + */ +public class VolumePrototypeResourceGroupResourceGroupIdentityByIdTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVolumePrototypeResourceGroupResourceGroupIdentityById() throws Throwable { + VolumePrototypeResourceGroupResourceGroupIdentityById volumePrototypeResourceGroupResourceGroupIdentityByIdModel = new VolumePrototypeResourceGroupResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + assertEquals(volumePrototypeResourceGroupResourceGroupIdentityByIdModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + + String json = TestUtilities.serialize(volumePrototypeResourceGroupResourceGroupIdentityByIdModel); + + VolumePrototypeResourceGroupResourceGroupIdentityById volumePrototypeResourceGroupResourceGroupIdentityByIdModelNew = TestUtilities.deserialize(json, VolumePrototypeResourceGroupResourceGroupIdentityById.class); + assertTrue(volumePrototypeResourceGroupResourceGroupIdentityByIdModelNew instanceof VolumePrototypeResourceGroupResourceGroupIdentityById); + assertEquals(volumePrototypeResourceGroupResourceGroupIdentityByIdModelNew.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testVolumePrototypeResourceGroupResourceGroupIdentityByIdError() throws Throwable { + new VolumePrototypeResourceGroupResourceGroupIdentityById.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupTest.java new file mode 100644 index 0000000000..b4bb2038a3 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeResourceGroupTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.VolumePrototypeResourceGroup; +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 VolumePrototypeResourceGroup model. + */ +public class VolumePrototypeResourceGroupTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testVolumePrototypeResourceGroup() throws Throwable { + VolumePrototypeResourceGroup volumePrototypeResourceGroupModel = new VolumePrototypeResourceGroup(); + assertNotNull(volumePrototypeResourceGroupModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceTest.java index 566fabcfaa..b8d64b4975 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceTest.java @@ -13,8 +13,10 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReference; import com.ibm.cloud.is.vpc.v1.model.VolumeReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -38,5 +40,7 @@ public void testVolumeReference() throws Throwable { assertNull(volumeReferenceModel.getHref()); assertNull(volumeReferenceModel.getId()); assertNull(volumeReferenceModel.getName()); + assertNull(volumeReferenceModel.getRemote()); + assertNull(volumeReferenceModel.getResourceType()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceVolumeAttachmentContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceVolumeAttachmentContextTest.java index 22fe963c39..89edd3ba02 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceVolumeAttachmentContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeReferenceVolumeAttachmentContextTest.java @@ -38,5 +38,6 @@ public void testVolumeReferenceVolumeAttachmentContext() throws Throwable { assertNull(volumeReferenceVolumeAttachmentContextModel.getHref()); assertNull(volumeReferenceVolumeAttachmentContextModel.getId()); assertNull(volumeReferenceVolumeAttachmentContextModel.getName()); + assertNull(volumeReferenceVolumeAttachmentContextModel.getResourceType()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeRemoteTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeRemoteTest.java new file mode 100644 index 0000000000..a4bfc532cc --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeRemoteTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2021, 2022, 2023. + * + * 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.RegionReference; +import com.ibm.cloud.is.vpc.v1.model.VolumeRemote; +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 VolumeRemote model. + */ +public class VolumeRemoteTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVolumeRemote() throws Throwable { + VolumeRemote volumeRemoteModel = new VolumeRemote(); + assertNull(volumeRemoteModel.getRegion()); + } +} \ No newline at end of file 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 4939a0b24d..d5afd657e0 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 @@ -13,15 +13,19 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageReferenceDeleted; +import com.ibm.cloud.is.vpc.v1.model.ImageRemote; import com.ibm.cloud.is.vpc.v1.model.InstanceReference; import com.ibm.cloud.is.vpc.v1.model.InstanceReferenceDeleted; import com.ibm.cloud.is.vpc.v1.model.OperatingSystem; +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.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotReferenceDeleted; +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.VolumeAttachmentDevice; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentReferenceVolumeContext; @@ -66,6 +70,7 @@ public void testVolume() throws Throwable { assertNull(volumeModel.getOperatingSystem()); assertNull(volumeModel.getProfile()); assertNull(volumeModel.getResourceGroup()); + assertNull(volumeModel.getResourceType()); assertNull(volumeModel.getSourceImage()); assertNull(volumeModel.getSourceSnapshot()); assertNull(volumeModel.getStatus());