@@ -57,7 +57,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
57
57
// To access additional configuration values, uncomment this line and extract the values from config
58
58
// const config = readExternalSources(IbmAnalyticsEngineApiV3.DEFAULT_SERVICE_NAME);
59
59
60
- test ( 'Initialize services ' , async ( ) => {
60
+ test ( 'Initialize service ' , async ( ) => {
61
61
// begin-common
62
62
63
63
ibmAnalyticsEngineApiService = IbmAnalyticsEngineApiV3 . newInstance ( ) ;
@@ -79,7 +79,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
79
79
// begin-get_instance
80
80
81
81
const params = {
82
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
82
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
83
83
} ;
84
84
85
85
let res ;
@@ -107,7 +107,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
107
107
// begin-get_instance_state
108
108
109
109
const params = {
110
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
110
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
111
111
} ;
112
112
113
113
let res ;
@@ -135,7 +135,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
135
135
// begin-set_instance_home
136
136
137
137
const params = {
138
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
138
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
139
139
newHmacAccessKey : 'b9****************************4b' ,
140
140
newHmacSecretKey : 'fa********************************************8a' ,
141
141
} ;
@@ -151,6 +151,36 @@ describe('IbmAnalyticsEngineApiV3', () => {
151
151
// end-set_instance_home
152
152
} ) ;
153
153
154
+ test ( 'updateInstanceHomeCredentials request example' , async ( ) => {
155
+ consoleLogMock . mockImplementation ( ( output ) => {
156
+ originalLog ( output ) ;
157
+ } ) ;
158
+ consoleWarnMock . mockImplementation ( ( output ) => {
159
+ // if an error occurs, display the message and then fail the test
160
+ originalWarn ( output ) ;
161
+ expect ( true ) . toBeFalsy ( ) ;
162
+ } ) ;
163
+
164
+ originalLog ( 'updateInstanceHomeCredentials() result:' ) ;
165
+ // begin-update_instance_home_credentials
166
+
167
+ const params = {
168
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09' ,
169
+ hmacAccessKey : 'b9****************************4b' ,
170
+ hmacSecretKey : 'fa********************************************8a' ,
171
+ } ;
172
+
173
+ let res ;
174
+ try {
175
+ res = await ibmAnalyticsEngineApiService . updateInstanceHomeCredentials ( params ) ;
176
+ console . log ( JSON . stringify ( res . result , null , 2 ) ) ;
177
+ } catch ( err ) {
178
+ console . warn ( err ) ;
179
+ }
180
+
181
+ // end-update_instance_home_credentials
182
+ } ) ;
183
+
154
184
test ( 'getInstanceDefaultConfigs request example' , async ( ) => {
155
185
consoleLogMock . mockImplementation ( ( output ) => {
156
186
originalLog ( output ) ;
@@ -165,7 +195,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
165
195
// begin-get_instance_default_configs
166
196
167
197
const params = {
168
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
198
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
169
199
} ;
170
200
171
201
let res ;
@@ -193,7 +223,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
193
223
// begin-replace_instance_default_configs
194
224
195
225
const params = {
196
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
226
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
197
227
body : {
198
228
'spark.driver.memory' : '8G' ,
199
229
'spark.driver.cores' : '2' ,
@@ -225,7 +255,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
225
255
// begin-update_instance_default_configs
226
256
227
257
const params = {
228
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
258
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
229
259
body : {
230
260
'ae.spark.history-server.cores' : '1' ,
231
261
'ae.spark.history-server.memory' : '4G' ,
@@ -257,7 +287,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
257
287
// begin-get_instance_default_runtime
258
288
259
289
const params = {
260
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
290
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
261
291
} ;
262
292
263
293
let res ;
@@ -285,7 +315,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
285
315
// begin-replace_instance_default_runtime
286
316
287
317
const params = {
288
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
318
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
289
319
sparkVersion : '3.3' ,
290
320
} ;
291
321
@@ -313,15 +343,23 @@ describe('IbmAnalyticsEngineApiV3', () => {
313
343
originalLog ( 'createApplication() result:' ) ;
314
344
// begin-create_application
315
345
346
+ // Request models needed by this operation.
347
+
348
+ // Runtime
349
+ const runtimeModel = {
350
+ spark_version : '3.3' ,
351
+ } ;
352
+
353
+ // ApplicationRequestApplicationDetails
354
+ const applicationRequestApplicationDetailsModel = {
355
+ application : '/opt/ibm/spark/examples/src/main/python/wordcount.py' ,
356
+ runtime : runtimeModel ,
357
+ arguments : [ '/opt/ibm/spark/examples/src/main/resources/people.txt' ] ,
358
+ } ;
359
+
316
360
const params = {
317
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546' ,
318
- applicationDetails : {
319
- application : '/opt/ibm/spark/examples/src/main/python/wordcount.py' ,
320
- arguments : [ '/opt/ibm/spark/examples/src/main/resources/people.txt' ] ,
321
- } ,
322
- runtime : {
323
- spark_version : '3.1' ,
324
- } ,
361
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09' ,
362
+ applicationDetails : applicationRequestApplicationDetailsModel ,
325
363
} ;
326
364
327
365
let res ;
@@ -349,7 +387,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
349
387
// begin-list_applications
350
388
351
389
const params = {
352
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
390
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
353
391
state : [ 'accepted' , 'running' , 'finished' , 'failed' ] ,
354
392
} ;
355
393
@@ -378,8 +416,8 @@ describe('IbmAnalyticsEngineApiV3', () => {
378
416
// begin-get_application
379
417
380
418
const params = {
381
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
382
- applicationId : 'db933645-0b68-4dcb-80d8-7b71a6c8e542 ' ,
419
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
420
+ applicationId : 'ff48cc19-0e7e-4627-aac6-0b4ad080397b ' ,
383
421
} ;
384
422
385
423
let res ;
@@ -407,8 +445,8 @@ describe('IbmAnalyticsEngineApiV3', () => {
407
445
// begin-get_application_state
408
446
409
447
const params = {
410
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
411
- applicationId : 'db933645-0b68-4dcb-80d8-7b71a6c8e542 ' ,
448
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
449
+ applicationId : 'ff48cc19-0e7e-4627-aac6-0b4ad080397b ' ,
412
450
} ;
413
451
414
452
let res ;
@@ -436,7 +474,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
436
474
// begin-get_current_resource_consumption
437
475
438
476
const params = {
439
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
477
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
440
478
} ;
441
479
442
480
let res ;
@@ -464,7 +502,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
464
502
// begin-get_resource_consumption_limits
465
503
466
504
const params = {
467
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
505
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
468
506
} ;
469
507
470
508
let res ;
@@ -492,7 +530,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
492
530
// begin-replace_log_forwarding_config
493
531
494
532
const params = {
495
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
533
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
496
534
enabled : true ,
497
535
} ;
498
536
@@ -521,7 +559,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
521
559
// begin-get_log_forwarding_config
522
560
523
561
const params = {
524
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
562
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
525
563
} ;
526
564
527
565
let res ;
@@ -549,7 +587,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
549
587
// begin-configure_platform_logging
550
588
551
589
const params = {
552
- instanceGuid : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
590
+ instanceGuid : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
553
591
enable : true ,
554
592
} ;
555
593
@@ -578,7 +616,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
578
616
// begin-get_logging_configuration
579
617
580
618
const params = {
581
- instanceGuid : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
619
+ instanceGuid : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
582
620
} ;
583
621
584
622
let res ;
@@ -606,7 +644,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
606
644
// begin-start_spark_history_server
607
645
608
646
const params = {
609
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
647
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
610
648
} ;
611
649
612
650
let res ;
@@ -634,7 +672,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
634
672
// begin-get_spark_history_server
635
673
636
674
const params = {
637
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546 ' ,
675
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09 ' ,
638
676
} ;
639
677
640
678
let res ;
@@ -648,7 +686,7 @@ describe('IbmAnalyticsEngineApiV3', () => {
648
686
// end-get_spark_history_server
649
687
} ) ;
650
688
651
- test ( 'stopSparkHistoryServer request example' , async ( ) => {
689
+ test ( 'deleteApplication request example' , async ( ) => {
652
690
consoleLogMock . mockImplementation ( ( output ) => {
653
691
originalLog ( output ) ;
654
692
} ) ;
@@ -658,22 +696,23 @@ describe('IbmAnalyticsEngineApiV3', () => {
658
696
expect ( true ) . toBeFalsy ( ) ;
659
697
} ) ;
660
698
661
- // begin-stop_spark_history_server
699
+ // begin-delete_application
662
700
663
701
const params = {
664
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546' ,
702
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09' ,
703
+ applicationId : 'ff48cc19-0e7e-4627-aac6-0b4ad080397b' ,
665
704
} ;
666
705
667
706
try {
668
- await ibmAnalyticsEngineApiService . stopSparkHistoryServer ( params ) ;
707
+ await ibmAnalyticsEngineApiService . deleteApplication ( params ) ;
669
708
} catch ( err ) {
670
709
console . warn ( err ) ;
671
710
}
672
711
673
- // end-stop_spark_history_server
712
+ // end-delete_application
674
713
} ) ;
675
714
676
- test ( 'deleteApplication request example' , async ( ) => {
715
+ test ( 'stopSparkHistoryServer request example' , async ( ) => {
677
716
consoleLogMock . mockImplementation ( ( output ) => {
678
717
originalLog ( output ) ;
679
718
} ) ;
@@ -683,19 +722,18 @@ describe('IbmAnalyticsEngineApiV3', () => {
683
722
expect ( true ) . toBeFalsy ( ) ;
684
723
} ) ;
685
724
686
- // begin-delete_application
725
+ // begin-stop_spark_history_server
687
726
688
727
const params = {
689
- instanceId : 'dc0e9889-eab2-4t9e-9441-566209499546' ,
690
- applicationId : 'db933645-0b68-4dcb-80d8-7b71a6c8e542' ,
728
+ instanceId : 'e64c907a-e82f-46fd-addc-ccfafbd28b09' ,
691
729
} ;
692
730
693
731
try {
694
- await ibmAnalyticsEngineApiService . deleteApplication ( params ) ;
732
+ await ibmAnalyticsEngineApiService . stopSparkHistoryServer ( params ) ;
695
733
} catch ( err ) {
696
734
console . warn ( err ) ;
697
735
}
698
736
699
- // end-delete_application
737
+ // end-stop_spark_history_server
700
738
} ) ;
701
739
} ) ;
0 commit comments