22
22
import com .ibm .cloud .is .vpc .v1 .model .AddressPrefixPatch ;
23
23
import com .ibm .cloud .is .vpc .v1 .model .BackupPoliciesPager ;
24
24
import com .ibm .cloud .is .vpc .v1 .model .BackupPolicy ;
25
+ import com .ibm .cloud .is .vpc .v1 .model .BackupPolicyJob ;
26
+ import com .ibm .cloud .is .vpc .v1 .model .BackupPolicyJobsPager ;
25
27
import com .ibm .cloud .is .vpc .v1 .model .BackupPolicyPatch ;
26
28
import com .ibm .cloud .is .vpc .v1 .model .BackupPolicyPlan ;
27
29
import com .ibm .cloud .is .vpc .v1 .model .BackupPolicyPlanCollection ;
184
186
import com .ibm .cloud .is .vpc .v1 .model .FlowLogCollectorPatch ;
185
187
import com .ibm .cloud .is .vpc .v1 .model .FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById ;
186
188
import com .ibm .cloud .is .vpc .v1 .model .FlowLogCollectorsPager ;
189
+ import com .ibm .cloud .is .vpc .v1 .model .GetBackupPolicyJobOptions ;
187
190
import com .ibm .cloud .is .vpc .v1 .model .GetBackupPolicyOptions ;
188
191
import com .ibm .cloud .is .vpc .v1 .model .GetBackupPolicyPlanOptions ;
189
192
import com .ibm .cloud .is .vpc .v1 .model .GetBareMetalServerDiskOptions ;
316
319
import com .ibm .cloud .is .vpc .v1 .model .KeysPager ;
317
320
import com .ibm .cloud .is .vpc .v1 .model .LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName ;
318
321
import com .ibm .cloud .is .vpc .v1 .model .ListBackupPoliciesOptions ;
322
+ import com .ibm .cloud .is .vpc .v1 .model .ListBackupPolicyJobsOptions ;
319
323
import com .ibm .cloud .is .vpc .v1 .model .ListBackupPolicyPlansOptions ;
320
324
import com .ibm .cloud .is .vpc .v1 .model .ListBareMetalServerDisksOptions ;
321
325
import com .ibm .cloud .is .vpc .v1 .model .ListBareMetalServerNetworkInterfaceFloatingIpsOptions ;
414
418
import com .ibm .cloud .is .vpc .v1 .model .NetworkACLRule ;
415
419
import com .ibm .cloud .is .vpc .v1 .model .NetworkACLRuleItem ;
416
420
import com .ibm .cloud .is .vpc .v1 .model .NetworkACLRulePatch ;
417
- import com .ibm .cloud .is .vpc .v1 .model .NetworkACLRulePrototypeNetworkACLRuleProtocolICMP ;
421
+ import com .ibm .cloud .is .vpc .v1 .model .NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype ;
418
422
import com .ibm .cloud .is .vpc .v1 .model .NetworkAclRulesPager ;
419
423
import com .ibm .cloud .is .vpc .v1 .model .NetworkAclsPager ;
420
424
import com .ibm .cloud .is .vpc .v1 .model .NetworkInterface ;
549
553
import com .ibm .cloud .is .vpc .v1 .model .VolumeAttachmentCollection ;
550
554
import com .ibm .cloud .is .vpc .v1 .model .VolumeAttachmentPatch ;
551
555
import com .ibm .cloud .is .vpc .v1 .model .VolumeAttachmentPrototypeInstanceByImageContext ;
552
- import com .ibm .cloud .is .vpc .v1 .model .VolumeAttachmentPrototypeInstanceContext ;
556
+ import com .ibm .cloud .is .vpc .v1 .model .VolumeAttachmentPrototype ;
553
557
import com .ibm .cloud .is .vpc .v1 .model .VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById ;
554
- import com .ibm .cloud .is .vpc .v1 .model .VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity ;
558
+ import com .ibm .cloud .is .vpc .v1 .model .VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity ;
555
559
import com .ibm .cloud .is .vpc .v1 .model .VolumeIdentityById ;
556
560
import com .ibm .cloud .is .vpc .v1 .model .VolumePatch ;
557
561
import com .ibm .cloud .is .vpc .v1 .model .VolumeProfile ;
@@ -665,6 +669,7 @@ public class VPCExamples {
665
669
static String bareMetalServerNetworkInterfaceId ;
666
670
static String bareMetalServerNetworkInterfaceReservedIp ;
667
671
static String backupPolicyId ;
672
+ static String backupPolicyJobId ;
668
673
static String backupPolicyPlanId ;
669
674
static String ifMatchBackupPolicy ;
670
675
static String ifMatchBackupPolicyPlan ;
@@ -1477,6 +1482,43 @@ public static void main(String[] args) throws Exception {
1477
1482
e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1478
1483
}
1479
1484
1485
+ try {
1486
+ System .out .println ("listOperatingSystems() result:" );
1487
+ // begin-list_operating_systems
1488
+ ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions .Builder ()
1489
+ .limit (Long .valueOf (10 ))
1490
+ .build ();
1491
+
1492
+ OperatingSystemsPager pager = new OperatingSystemsPager (vpcService , listOperatingSystemsOptions );
1493
+ List <OperatingSystem > allResults = new ArrayList <>();
1494
+ while (pager .hasNext ()) {
1495
+ List <OperatingSystem > nextPage = pager .getNext ();
1496
+ allResults .addAll (nextPage );
1497
+ }
1498
+
1499
+ // end-list_operating_systems
1500
+ operatingSystemName = allResults .get (0 ).getName ();
1501
+ } catch (ServiceResponseException e ) {
1502
+ logger .error (String .format ("Service returned status code %s: %s%nError details: %s" ,
1503
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1504
+ }
1505
+
1506
+ try {
1507
+ System .out .println ("getOperatingSystem() result:" );
1508
+ // begin-get_operating_system
1509
+ GetOperatingSystemOptions getOperatingSystemOptions = new GetOperatingSystemOptions .Builder ()
1510
+ .name (operatingSystemName )
1511
+ .build ();
1512
+
1513
+ Response <OperatingSystem > response = vpcService .getOperatingSystem (getOperatingSystemOptions ).execute ();
1514
+ OperatingSystem operatingSystem = response .getResult ();
1515
+
1516
+ // end-get_operating_system
1517
+ } catch (ServiceResponseException e ) {
1518
+ logger .error (String .format ("Service returned status code %s: %s%nError details: %s" ,
1519
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1520
+ }
1521
+
1480
1522
try {
1481
1523
System .out .println ("listImages() result:" );
1482
1524
// begin-list_images
@@ -1492,7 +1534,6 @@ public static void main(String[] args) throws Exception {
1492
1534
}
1493
1535
1494
1536
// end-list_images
1495
- operatingSystemName = allResults .get (0 ).getOperatingSystem ().getName ();
1496
1537
} catch (ServiceResponseException e ) {
1497
1538
logger .error (String .format ("Service returned status code %s: %s%nError details: %s" ,
1498
1539
e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
@@ -1563,43 +1604,6 @@ public static void main(String[] args) throws Exception {
1563
1604
e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1564
1605
}
1565
1606
1566
- try {
1567
- System .out .println ("listOperatingSystems() result:" );
1568
- // begin-list_operating_systems
1569
- ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions .Builder ()
1570
- .limit (Long .valueOf (10 ))
1571
- .build ();
1572
-
1573
- OperatingSystemsPager pager = new OperatingSystemsPager (vpcService , listOperatingSystemsOptions );
1574
- List <OperatingSystem > allResults = new ArrayList <>();
1575
- while (pager .hasNext ()) {
1576
- List <OperatingSystem > nextPage = pager .getNext ();
1577
- allResults .addAll (nextPage );
1578
- }
1579
-
1580
- // end-list_operating_systems
1581
- operatingSystemName = allResults .get (0 ).getName ();
1582
- } catch (ServiceResponseException e ) {
1583
- logger .error (String .format ("Service returned status code %s: %s%nError details: %s" ,
1584
- e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1585
- }
1586
-
1587
- try {
1588
- System .out .println ("getOperatingSystem() result:" );
1589
- // begin-get_operating_system
1590
- GetOperatingSystemOptions getOperatingSystemOptions = new GetOperatingSystemOptions .Builder ()
1591
- .name (operatingSystemName )
1592
- .build ();
1593
-
1594
- Response <OperatingSystem > response = vpcService .getOperatingSystem (getOperatingSystemOptions ).execute ();
1595
- OperatingSystem operatingSystem = response .getResult ();
1596
-
1597
- // end-get_operating_system
1598
- } catch (ServiceResponseException e ) {
1599
- logger .error (String .format ("Service returned status code %s: %s%nError details: %s" ,
1600
- e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1601
- }
1602
-
1603
1607
try {
1604
1608
System .out .println ("listKeys() result:" );
1605
1609
// begin-list_keys
@@ -1922,6 +1926,45 @@ public static void main(String[] args) throws Exception {
1922
1926
e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1923
1927
}
1924
1928
1929
+
1930
+ try {
1931
+ System .out .println ("listBackupPolicyJobs() result:" );
1932
+ // begin-list_backup_policy_jobs
1933
+ ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions .Builder ()
1934
+ .backupPolicyId (backupPolicyId )
1935
+ .build ();
1936
+
1937
+ BackupPolicyJobsPager pager = new BackupPolicyJobsPager (vpcService , listBackupPolicyJobsOptions );
1938
+ List <BackupPolicyJob > allResults = new ArrayList <>();
1939
+ while (pager .hasNext ()) {
1940
+ List <BackupPolicyJob > nextPage = pager .getNext ();
1941
+ allResults .addAll (nextPage );
1942
+ }
1943
+
1944
+ // end-list_backup_policy_jobs
1945
+ backupPolicyJobId = allResults .get (0 ).getId ();
1946
+ } catch (ServiceResponseException e ) {
1947
+ logger .error (String .format ("Service returned status code %s: %s%nError details: %s" ,
1948
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1949
+ }
1950
+
1951
+ try {
1952
+ System .out .println ("getBackupPolicyJob() result:" );
1953
+ // begin-get_backup_policy_job
1954
+ GetBackupPolicyJobOptions getBackupPolicyJobOptions = new GetBackupPolicyJobOptions .Builder ()
1955
+ .backupPolicyId (backupPolicyId )
1956
+ .id (backupPolicyJobId )
1957
+ .build ();
1958
+
1959
+ Response <BackupPolicyJob > response = vpcService .getBackupPolicyJob (getBackupPolicyJobOptions ).execute ();
1960
+ BackupPolicyJob backupPolicyJob = response .getResult ();
1961
+
1962
+ // end-get_backup_policy_job
1963
+ } catch (ServiceResponseException e ) {
1964
+ logger .error (String .format ("Service returned status code %s: %s%nError details: %s" ,
1965
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
1966
+ }
1967
+
1925
1968
try {
1926
1969
System .out .println ("listBackupPolicyPlans() result:" );
1927
1970
// begin-list_backup_policy_plans
@@ -2474,14 +2517,14 @@ public static void main(String[] args) throws Exception {
2474
2517
EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN .Builder ()
2475
2518
.crn (crn )
2476
2519
.build ();
2477
- VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity volumeAttachmentVolumePrototypeInstanceContextModel = new VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity .Builder ()
2520
+ VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel = new VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity .Builder ()
2478
2521
.name ("my-data-volume" )
2479
2522
.profile (volumeProfileIdentityModel )
2480
2523
.capacity (Long .valueOf ("1000" ))
2481
2524
.encryptionKey (encryptionKeyIdentityModel )
2482
2525
.build ();
2483
- VolumeAttachmentPrototypeInstanceContext volumeAttachmentPrototypeInstanceContextModel = new VolumeAttachmentPrototypeInstanceContext .Builder ()
2484
- .volume (volumeAttachmentVolumePrototypeInstanceContextModel )
2526
+ VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype .Builder ()
2527
+ .volume (volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacityModel )
2485
2528
.build ();
2486
2529
VPCIdentityById vpcIdentityModel = new VPCIdentityById .Builder ()
2487
2530
.id (vpcId )
@@ -2512,7 +2555,7 @@ public static void main(String[] args) throws Exception {
2512
2555
.name ("my-instance" )
2513
2556
.placementTarget (instancePlacementTargetPrototypeModel )
2514
2557
.profile (instanceProfileIdentityModel )
2515
- .volumeAttachments (new java .util .ArrayList <VolumeAttachmentPrototypeInstanceContext >(java .util .Arrays .asList (volumeAttachmentPrototypeInstanceContextModel )))
2558
+ .volumeAttachments (new java .util .ArrayList <VolumeAttachmentPrototype >(java .util .Arrays .asList (volumeAttachmentPrototypeModel )))
2516
2559
.vpc (vpcIdentityModel )
2517
2560
.bootVolumeAttachment (volumeAttachmentPrototypeInstanceByImageContextModel )
2518
2561
.image (imageIdentityModel )
@@ -4097,7 +4140,7 @@ public static void main(String[] args) throws Exception {
4097
4140
try {
4098
4141
System .out .println ("createNetworkAclRule() result:" );
4099
4142
// begin-create_network_acl_rule
4100
- NetworkACLRulePrototypeNetworkACLRuleProtocolICMP networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolICMP .Builder ()
4143
+ NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype networkACLRulePrototypeNetworkACLRuleProtocolICMPPrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype .Builder ()
4101
4144
.action ("allow" )
4102
4145
.destination ("192.168.3.2/32" )
4103
4146
.direction ("inbound" )
@@ -4107,7 +4150,7 @@ public static void main(String[] args) throws Exception {
4107
4150
.build ();
4108
4151
CreateNetworkAclRuleOptions createNetworkAclRuleOptions = new CreateNetworkAclRuleOptions .Builder ()
4109
4152
.networkAclId (networkAclId )
4110
- .networkAclRulePrototype (networkAclRulePrototypeModel )
4153
+ .networkAclRulePrototype (networkACLRulePrototypeNetworkACLRuleProtocolICMPPrototypeModel )
4111
4154
.build ();
4112
4155
4113
4156
Response <NetworkACLRule > response = vpcService .createNetworkAclRule (createNetworkAclRuleOptions ).execute ();
@@ -4395,10 +4438,10 @@ public static void main(String[] args) throws Exception {
4395
4438
System .out .println ("createIkePolicy() result:" );
4396
4439
// begin-create_ike_policy
4397
4440
CreateIkePolicyOptions createIkePolicyOptions = new CreateIkePolicyOptions .Builder ()
4398
- .authenticationAlgorithm ("md5 " )
4441
+ .authenticationAlgorithm ("sha512 " )
4399
4442
.name ("my-ike-policy" )
4400
- .dhGroup (Long .valueOf ("2 " ))
4401
- .encryptionAlgorithm ("triple_des " )
4443
+ .dhGroup (Long .valueOf ("14 " ))
4444
+ .encryptionAlgorithm ("aes128 " )
4402
4445
.ikeVersion (Long .valueOf ("1" ))
4403
4446
.build ();
4404
4447
@@ -4490,8 +4533,8 @@ public static void main(String[] args) throws Exception {
4490
4533
// begin-create_ipsec_policy
4491
4534
CreateIpsecPolicyOptions createIpsecPolicyOptions = new CreateIpsecPolicyOptions .Builder ()
4492
4535
.name ("my-ipsec-policy" )
4493
- .authenticationAlgorithm ("md5 " )
4494
- .encryptionAlgorithm ("triple_des " )
4536
+ .authenticationAlgorithm ("sha512 " )
4537
+ .encryptionAlgorithm ("aes128 " )
4495
4538
.pfs ("disabled" )
4496
4539
.build ();
4497
4540
0 commit comments