[AAI] Add the aai performance test script files
[aai/test-config.git] / gatling / ONAP Baseline 2022.scala
1 import io.gatling.core.Predef.{exec, _}
2 import io.gatling.http.Predef._
3 import _root_.io.gatling.core.scenario.Simulation
4 import java.util.UUID
5 import scala.concurrent.duration._
6
7 import scala.util.Random
8
9 class ONAP_2204_Baseline extends Simulation {
10   val httpHeaders = Map(
11     "Accept" -> """application/json""",
12     "Content-Type"-> """application/json""",
13       "X-FromAppId"-> """ONAP-fromappId""",
14     "X-TransactionId"-> """ONAP-transId""",
15     "Connection"-> """Keep-Alive"""
16   )
17
18   def idGenerator() = "random-" + UUID.randomUUID().toString;
19   val r = scala.util.Random
20   val feeder = Iterator.continually(Map("randVal" -> (Random.alphanumeric.take(20).mkString)))
21
22   val PServerFeeder = csv("./src/test/gatling/bodies/onappservers.csv").random
23   val serviceInstanceFeeder = csv("./src/test/gatling/bodies/onapserviceinstance.csv").random
24   val genericvnfFeeder = csv("./src/test/gatling/bodies/onapvnfs.csv").random
25   val customerFeeder = csv("./src/test/gatling/bodies/onapcustomers.csv").random
26   val vnfcFeeder = csv("./src/test/gatling/bodies/onapvnfcs.csv").random
27   val platformFeeder = csv("./src/test/gatling/bodies/onapplatform.csv").random
28   val pnfFeeder = csv("./src/test/gatling/bodies/onappnfs.csv").random
29   val configurationFeeder = csv("./src/test/gatling/bodies/onapconfigurations.csv").random
30   val owningentityFeeder = csv("./src/test/gatling/bodies/onapowning_entity.csv").random
31   val projectFeeder = csv("./src/test/gatling/bodies/onapproject.csv").random
32   val lobFeeder = csv("./src/test/gatling/bodies/onapLOB.csv").random
33
34   val host = System.getProperty("TARGET_HOST", "Enter Host with Port");
35   val url = "Enter host without port"
36
37   val httpBuilder = http.baseURL(host);
38
39
40   /***
41     *
42     * @param env
43     * Sends a PUT tenant request
44     */
45   def PutTenant(env: String) = scenario("Put Tenant " + env)
46     .forever(){
47       exec(session => {
48         session.set("stenant", idGenerator())
49       })
50       .exec(
51         http("PutTenant " + env)
52         .put("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner4/onap-CRId4/tenants/tenant/${stenant}")
53         .body(ElFileBody("newtenant_valid.json"))
54         .headers(httpHeaders)
55         .check(
56           status.find.in(201)
57         )
58       )
59       .pause(2,13)
60       .exec(
61         http("GetTenant " + env)
62         .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner4/onap-CRId4/tenants/tenant/${stenant}")
63         .headers(httpHeaders)
64         .check(
65           status.find.in(200)
66         )
67         .check(jsonPath("$.resource-version").saveAs("resourcever"))
68       )
69       .exec(
70         http("DelTenant " + env)
71         .delete("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner4/onap-CRId4/tenants/tenant/${stenant}?resource-version=${resourcever}")
72         .headers(httpHeaders)
73         .check(status.find.in(204))
74       )
75       .pause(1,1)
76    }
77
78      /***
79     *
80     * @param env
81     * Sends a PATCH tenant request
82     */
83   def PatchTenant(env: String) = scenario("Patch Tenant " + env)
84     .forever(){
85 // Get the resource version before doing the PATCH
86       exec(
87         http("Get Tenant " + env)
88         .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenant-patch")
89         .headers(httpHeaders)
90         .check(
91           status.find.in(200)
92         )
93         .check(
94           jsonPath("$.resource-version").saveAs("rsrcver")
95           )
96       )
97       .pause(1,1)
98
99       .exec(
100         http("Patch Tenant " + env)
101         .patch("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenant-patch?resource-version=${rsrcver}")
102         .headers(httpHeaders)
103         .headers(Map(
104           "Content-Type"-> """application/merge-patch+json"""
105         ))
106         .body(ElFileBody("patch-tenant.json"))
107         .check(
108           status.find.in(200)
109         )
110       )
111       .pause(2,5)
112     }
113
114  /***
115     *
116     * @param env
117     * @return Tenant Get depth0
118     */
119   def GetTenant(env: String) = scenario("Get Tenantdepth0 " + env)
120     .forever(){
121       exec(
122         http("Get Tenantdepth0 " + env)
123         .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner3/onap-CRId3/tenants/tenant/onap-tenantId3?depth=0")
124         .headers(httpHeaders)
125         .check(
126           status.find.in(200)
127         )
128       )
129       .pause(2,6)
130 }
131
132   /***
133     *
134     * @param env
135     * Sends a DELETE tenant request
136     */
137   def DeleteTenant(env: String) = scenario("Delete Tenant " + env)
138     .forever(){
139       exec(session => {
140         session.set("stenant", idGenerator())
141       })
142       .exec(
143         http("PutTenant " + env)
144         .put("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner5/onap-CRId5/tenants/tenant/${stenant}")
145         .body(ElFileBody("newtenant_valid.json"))
146         .headers(httpHeaders)
147         .check(
148           status.find.in(201)
149         )
150       )
151       .pause(1,1)
152       .exec(
153         http("GetTenant " + env)
154         .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner5/onap-CRId5/tenants/tenant/${stenant}")
155         .headers(httpHeaders)
156         .check(
157           status.find.in(200)
158         )
159         .check(jsonPath("$.resource-version").saveAs("resourcever"))
160       )
161       .exec(
162         http("DeleteTenant " + env)
163         .delete("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner5/onap-CRId5/tenants/tenant/${stenant}?resource-version=${resourcever}")
164         .headers(httpHeaders)
165         .check(status.find.in(204))
166       )
167       .pause(1,1)
168    }
169
170   /**
171     *
172     * @param env
173     * @Send a GET Vserver depth=all request
174     */
175     def Getvserver1(env: String) = scenario("Get Vserverdepthall " + env)
176       .forever(){
177          exec(
178           http("Get Vserverdepthall " + env)
179           .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner2/onap-CRId2/tenants/tenant/onap-tenantId2/vservers/vserver/onap-vserverId2?depth=all")
180           .headers(httpHeaders)
181           .check(
182             status.find.in(200)
183           )
184         )
185         .pause(2,5)
186       }
187
188   /**
189     *
190     * @param env
191     * @Send a GET VF-Module depth=1request
192     */
193     def GetVFModule1(env: String) = scenario("Get VF-Moduledepth1 " + env)
194       .forever(){
195         exec(
196           http("Get VF-Moduledepthl " + env)
197           .get("/aai/v23/network/generic-vnfs/generic-vnf/onap-genericvnfId/vf-modules/vf-module/onap-vnfmoduleId?depth=1")
198           .headers(httpHeaders)
199           .check(
200             status.find.in(200)
201           )
202         )
203         .pause(2,5)
204       }
205
206   /**
207     *
208     * @param env
209     * @Send a GET Vserver request
210     */
211     def Getvserver2(env: String) = scenario("Get Vserver " + env)
212       .forever(){
213          exec(
214           http("Get Vserver " + env)
215           .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner2/onap-CRId2/tenants/tenant/onap-tenantId2/vservers/vserver/onap-vserverId2")
216           .headers(httpHeaders)
217           .check(
218             status.find.in(200)
219           )
220         )
221         .pause(2,6)
222       }
223
224   /**
225     *
226     * @param env
227     * @Send a GET SI format=pathed request
228     */
229     def GetSI1(env: String) = scenario("Get SIpathed " + env)
230       .forever(){
231         feed(serviceInstanceFeeder)
232         .exec(
233           http("Get SIpathed " + env)
234           .get("/aai/v23/nodes/service-instances/service-instance/${service-instance-id}?format=pathed")
235           .headers(httpHeaders)
236           .check(
237             status.find.in(200)
238           )
239         )
240         .pause(2,3)
241       }
242
243             /**
244     *
245     * @param env
246     * @Send a V23 GET vnf request
247     */
248     def GetVNF1(env: String) = scenario("Get VNF " + env)
249       .forever(){
250         feed(genericvnfFeeder)
251         .exec(
252           http("Get VNF " + env)
253           .get("/aai/v23/network/generic-vnfs/generic-vnf/${vnf-id}")
254           .headers(httpHeaders)
255           .check(
256             status.find.in(200)
257           )
258         )
259         .pause(2,5)
260       }
261
262   /**
263     *
264     * @param env
265     * @Send a GET vnf depth=1 request
266     */
267     def GetVNF2(env: String) = scenario("Get VNFdepth1 " + env)
268       .forever(){
269         feed(genericvnfFeeder)
270         .exec(
271           http("Get VNFdepth1 " + env)
272           .get("/aai/v23/network/generic-vnfs/generic-vnf/${vnf-id}?depth=1")
273           .headers(httpHeaders)
274           .check(
275             status.find.in(200)
276           )
277         )
278         .pause(2,5)
279       }
280
281
282             /**
283     *
284     * @param env
285     * @Send a GET pservers depth=all request
286     */
287     def GetPserver1(env: String) = scenario("Get Pserverdepthall " + env)
288       .forever(){
289         feed(PServerFeeder)
290         .exec(
291           http("Get Pserverdepthall " + env)
292           .get("/aai/v22/cloud-infrastructure/pservers/pserver/${hostname}?depth=all")
293           .headers(httpHeaders)
294           .check(
295             status.find.in(200)
296           )
297         )
298         .pause(2,5)
299       }
300
301   /**
302     *
303     * @param env
304     * @Send a GET volume-group request
305     */
306     def Getvolumegroup(env: String) = scenario("Get volume-group " + env)
307       .forever(){
308          exec(
309           http("Get volume-group " + env)
310           .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/volume-groups/volume-group/onap-volumegpId")
311           .headers(httpHeaders)
312           .check(
313             status.find.in(200)
314           )
315         )
316         .pause(2,6)
317       }
318
319     /**
320     *
321     * @param env
322     * @Send a GET platform request
323     */
324     def Getplatform(env: String) = scenario("Get platformnodes-only " + env)
325       .forever(){
326         feed(platformFeeder)
327         .exec(
328           http("Get platformnodes-only " + env)
329           .get("/aai/v22/business/platforms/platform/${platform-name}?nodes-only=")
330           .headers(httpHeaders)
331           .check(
332             status.find.in(200)
333           )
334         )
335         .pause(2,6)
336       }
337
338   /**
339     *
340     * @param env
341     * @Send a GET sriov-vf depth=all request
342     */
343     def Getsriovvf1(env: String) = scenario("Get sriov-vfdepthall " + env)
344       .forever(){
345          exec(
346           http("Get sriov-vfdepthall " + env)
347           .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenantId/vservers/vserver/onap-vserverId/l-interfaces/l-interface/onap-linterfaceName/sriov-vfs/sriov-vf/onap-PciId?depth=all")
348           .headers(httpHeaders)
349           .check(
350             status.find.in(200)
351           )
352         )
353         .pause(2,6)
354       }
355
356     /**
357     *
358     * @param env
359     * @Send a GET pnf request
360     */
361     def Getpnf1(env: String) = scenario("Get pnf " + env)
362       .forever(){
363         feed(pnfFeeder)
364         .exec(
365           http("Get pnf " + env)
366           .get("/aai/v22/network/pnfs/pnf/${pnf-name}")
367           .headers(httpHeaders)
368           .check(
369             status.find.in(200)
370           )
371         )
372         .pause(2,6)
373       }
374
375               /**
376     *
377     * @param env
378     * @Send a vnfc depth=1 request
379     */
380     def Getvnfc1(env: String) = scenario("Get vnfcdepth1 " + env)
381       .forever(){
382         feed(vnfcFeeder)
383         .exec(
384           http("Get vnfcdepth1 " + env)
385           .get("/aai/v22/network/vnfcs/vnfc/${vnfc-name}?depth=1")
386           .headers(httpHeaders)
387           .check(
388             status.find.in(200)
389           )
390         )
391         .pause(2,5)
392       }
393
394   /**
395     *
396     * @param env
397     * @Send a GET vlan depth=1 request
398     */
399     def Getvlan(env: String) = scenario("Get vlandepth1 " + env)
400       .forever(){
401          exec(
402           http("Get vlandepth1 " + env)
403           .get("/aai/v22/network/generic-vnfs/generic-vnf/onap-genericvnfId/l-interfaces/l-interface/onap-linterfaceId/vlans/vlan/onap-vlanInterface?depth=1")
404           .headers(httpHeaders)
405           .check(
406             status.find.in(200)
407           )
408         )
409         .pause(2,5)
410       }
411
412   /**
413     *
414     * @param env
415     * @Send a GET SI depth=2 request
416     */
417     def GetSI2(env: String) = scenario("Get SIdepth2 " + env)
418       .forever(){
419          exec(
420           http("Get SIdepth2 " + env)
421           .get("/aai/v22/business/customers/customer/onap-customerId/service-subscriptions/service-subscription/onap-subscription-ServiceType/service-instances/service-instance/onap-serviceinstanceId?depth=2")
422           .headers(httpHeaders)
423           .check(
424             status.find.in(200)
425           )
426         )
427         .pause(2,4)
428       }
429
430             /**
431     *
432     * @param env
433     * @Send a GET pserver  request
434     */
435     def GetPserver2(env: String) = scenario("Get Pserver " + env)
436       .forever(){
437         feed(PServerFeeder)
438         .exec(
439           http("Get Pserver " + env)
440           .get("/aai/v22/cloud-infrastructure/pservers/pserver/${hostname}")
441           .headers(httpHeaders)
442           .check(
443             status.find.in(200)
444           )
445         )
446         .pause(2,5)
447       }
448
449                     /**
450     *
451     * @param env
452     * @Send a GET configuration depth=1 request
453     */
454     def Getconfiguration(env: String) = scenario("Get configurationdepth1 " + env)
455       .forever(){
456         feed(configurationFeeder)
457         .exec(
458           http("Get configurationdepth1 " + env)
459           .get("/aai/v22/network/configurations/configuration/${configuration-id}?depth=1")
460           .headers(httpHeaders)
461           .check(
462             status.find.in(200)
463           )
464         )
465         .pause(2,5)
466       }
467
468   /**
469     *
470     * @param env
471     * @Send a GET service-subscription request
472     */
473     def Getservicesubscription(env: String) = scenario("Get service-subscription " + env)
474       .forever(){
475          exec(
476           http("Getservice-subscription " + env)
477           .get("/aai/v22/business/customers/customer/onap-customerId/service-subscriptions/service-subscription/onap-subscription-ServiceType")
478           .headers(httpHeaders)
479           .check(
480             status.find.in(200)
481           )
482         )
483         .pause(2,5)
484       }
485
486     /**
487     *
488     * @param env
489     * @Send a GET pnf depth=all request
490     */
491     def Getpnf2(env: String) = scenario("Get pnfdepthall " + env)
492       .forever(){
493         feed(pnfFeeder)
494         .exec(
495           http("Get pnfdepthall " + env)
496           .get("/aai/v22/network/pnfs/pnf/${pnf-name}?depth=all")
497           .headers(httpHeaders)
498           .check(
499             status.find.in(200)
500           )
501         )
502         .pause(2,3)
503       }
504
505     /**
506     *
507     * @param env
508     * @Send a GET customer request
509     */
510     def Getcustomer(env: String) = scenario("Get customer " + env)
511       .forever(){
512         feed(customerFeeder)
513         .exec(
514           http("Get customer " + env)
515           .get("/aai/v21/business/customers/customer/${global-customer-id}")
516           .headers(httpHeaders)
517           .check(
518             status.find.in(200)
519           )
520         )
521         .pause(2,6)
522       }
523
524     /**
525     *
526     * @param env
527     * @Send a GET owningentity node-only request
528     */
529     def Getowningentity(env: String) = scenario("Get owningentitynodesonly " + env)
530       .forever(){
531         feed(owningentityFeeder)
532         .exec(
533           http("Get owningentitynodesonly " + env)
534           .get("/aai/v21/business/owning-entities/owning-entity/${owning-entity-id}?nodes-only=")
535           .headers(httpHeaders)
536           .check(
537             status.find.in(200)
538           )
539         )
540         .pause(2,6)
541       }
542
543               /**
544     *
545     * @param env
546     * @Send a GET vnfc request
547     */
548     def Getvnfc2(env: String) = scenario("Get vnfc " + env)
549       .forever(){
550         feed(vnfcFeeder)
551         .exec(
552           http("Get vnfc " + env)
553           .get("/aai/v22/network/vnfcs/vnfc/${vnfc-name}")
554           .headers(httpHeaders)
555           .check(
556             status.find.in(200)
557           )
558         )
559         .pause(2,6)
560       }
561
562   /**
563     *
564     * @param env
565     * @Send a GET vlan-tag depth=1 request
566     */
567     def Getvlantag(env: String) = scenario("Get vlantagdepth1 " + env)
568       .forever(){
569          exec(
570           http("Get vlantagdepth1 " + env)
571           .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/vlan-ranges/vlan-range/onap-vlanrangeId/vlan-tags?vlan-id-outer=168&depth=1")
572           .headers(httpHeaders)
573           .check(
574             status.find.in(200)
575           )
576         )
577         .pause(2,5)
578       }
579
580   /**
581     *
582     * @param env
583     * @Send a GET project nodes-only request
584     */
585     def Getproject(env: String) = scenario("Get projectnodes-only " + env)
586       .forever(){
587            feed(projectFeeder)
588          .exec(
589           http("Get projectnodes-only " + env)
590           .get("/aai/v21/business/projects/project/${project-name}?nodes-only=")
591           .headers(httpHeaders)
592           .check(
593             status.find.in(200)
594           )
595         )
596         .pause(2,6)
597       }
598
599   /**
600     *
601     * @param env
602     * @Send a GET LOB request
603     */
604     def Getlob(env: String) = scenario("Get LOB " + env)
605       .forever(){
606            feed(lobFeeder)
607          .exec(
608           http("Get LOB " + env)
609           .get("/aai/v21/business/lines-of-business/line-of-business/${line-of-business-name}")
610           .headers(httpHeaders)
611           .check(
612             status.find.in(200)
613           )
614         )
615         .pause(1,3)
616       }
617
618   /**
619     *
620     * @param env
621     * @Send a GET sriov-vf request
622     */
623     def Getsriovvf2(env: String) = scenario("Get sriov-vfcountIndexSize " + env)
624       .forever(){
625          exec(
626           http("Get sriov-vfcountIndexSize " + env)
627                   .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenantId/vservers/vserver/onap-vserverId/l-interfaces/l-interface/onap-linterfaceName/sriov-vfs/sriov-vf/onap-PciId?format=count&resultIndex=0&resultSize=1")
628           .headers(httpHeaders)
629           .check(
630             status.find.in(200)
631           )
632         )
633         .pause(2,6)
634       }
635
636   /**
637     *
638     * @param env
639     * @Send a GET snapshot depth=all request
640     */
641     def Getsnapshot(env: String) = scenario("Get snapshotdepthall " + env)
642       .forever(){
643          exec(
644           http("Get snapshotdepthall " + env)
645                   .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/snapshots/snapshot/onapsnapshotId?depth=all")
646           .headers(httpHeaders)
647           .check(
648             status.find.in(200)
649           )
650         )
651         .pause(2,6)
652       }
653
654   /**
655     *
656     * @param env
657     * @Send a GET volume depth=all request
658     */
659     def Getvolume(env: String) = scenario("Get volumedepthall " + env)
660       .forever(){
661          exec(
662           http("Get volumedepthall " + env)
663                   .get("/aai/v23/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenantId/vservers/vserver/onap-vserverId/volumes/volume/onap-volumeid?depth=all")
664           .headers(httpHeaders)
665           .check(
666             status.find.in(200)
667           )
668         )
669         .pause(2,6)
670       }
671
672             /**
673     *
674     * @param env
675     * @Send a GET CR with CRid request
676     */
677     def GetCR(env: String) = scenario("Get CRwithregionid " + env)
678       .forever(){
679          exec(
680           http("Get CRwithregionid " + env)
681                   .get("/aai/v22/cloud-infrastructure/cloud-regions/?cloud-region-id=onap-CRId")
682           .headers(httpHeaders)
683           .check(
684             status.find.in(200)
685           )
686         )
687         .pause(1,2)
688       }
689
690   /***
691     *
692     * @param env
693     * Sends a PUT then del vf-module request
694     */
695   def PUTvfmodule(env: String) = scenario("PUT vf-module " + env)
696     .forever(){
697         feed(genericvnfFeeder)
698       exec(session => {
699         session.set("svfmodule", idGenerator())
700       })
701       .exec(
702         http("PUT vf-module " + env)
703         .put("/aai/v23/network/generic-vnfs/generic-vnf/onap-genericvnfId/vf-modules/vf-module/${svfmodule}")
704         .body(ElFileBody("newvf-module_valid.json"))
705         .headers(httpHeaders)
706         .check(
707           status.find.in(201)
708         )
709       )
710       .pause(2,14)
711       .exec(
712         http("Getvfmodule " + env)
713         .get("/aai/v23/network/generic-vnfs/generic-vnf/onap-genericvnfId/vf-modules/vf-module/${svfmodule}")
714         .headers(httpHeaders)
715         .check(
716           status.find.in(200)
717         )
718         .check(jsonPath("$.resource-version").saveAs("resourcever"))
719       )
720       .exec(
721         http("Deletevfmodule " + env)
722         .delete("/aai/v23/network/generic-vnfs/generic-vnf/onap-genericvnfId/vf-modules/vf-module/${svfmodule}?resource-version=${resourcever}")
723         .headers(httpHeaders)
724         .check(status.find.in(204))
725       )
726       .pause(1,1)
727    }
728
729             /**
730     *
731     * @param env
732     * @Send a GET all services request
733     */
734     def Getallservices(env: String) = scenario("Get all services " + env)
735       .forever(){
736          exec(
737           http("Get all services " + env)
738                   .get("/aai/v22/service-design-and-creation/services")
739           .headers(httpHeaders)
740 .headers(Map(
741           "X-FromAppId"-> """ONAP-fromappId"""
742         ))
743           .check(
744             status.find.in(200)
745           )
746         )
747         .pause(2,20)
748       }
749
750   /***
751     *
752     * @param env
753     * Sends a PUT pservervserver request
754     */
755   def PostBulkSingleTx1(env: String) = scenario("BulkSingleTx1" + env)
756     //.feed(tenantFeeder)
757         .forever(){
758       exec(session => {
759         session.set("sPServer", idGenerator())
760       })
761       .exec(session => {
762         session.set("sVServer", idGenerator())
763       })
764       .exec(
765         http("BulkSingleTx1 " + env)
766         .post("/aai/v22/bulk/single-transaction")
767         .body(ElFileBody("onapbulk-single-tx_putPServerVServer.json"))
768         .headers(httpHeaders)
769         .check(
770           status.find.in(201)
771         )
772       )
773         .pause(2,5)
774         .exec(
775           http("Vserver " + env)
776           .get("/aai/v22/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenantId1/vservers/vserver/${sVServer}?depth=0&nodes-only=true")
777           .headers(httpHeaders)
778           .check(
779             status.find.in(200)
780           )
781           .check(jsonPath("$.resource-version").saveAs("rsrcver"))
782         )
783         .exec(
784          http("Vserver " + env)
785           .delete("/aai/v22/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenantId1/vservers/vserver/${sVServer}?resource-version=${rsrcver}")
786           .headers(httpHeaders)
787
788           .check(status.find.in(204))
789         )
790         .exec(
791           http("Pserver " + env)
792           .get("/aai/v22/cloud-infrastructure/pservers/pserver/${sPServer}?depth=0&nodes-only=true")
793           .headers(httpHeaders)
794           .check(
795             status.find.in(200)
796           )
797           .check(jsonPath("$.resource-version").saveAs("rsrcver"))
798         )
799         .exec(
800          http("Pserver " + env)
801           .delete("/aai/v22/cloud-infrastructure/pservers/pserver/${sPServer}?resource-version=${rsrcver}")
802           .headers(httpHeaders)
803           .check(status.find.in(204))
804         )
805       .pause(1,9)
806     }
807
808  /***
809     *
810     * @param env
811     * Sends a PUT pservervserver2 request
812     */
813   def PostBulkSingleTx2(env: String) = scenario("BulkSingleTx2 " + env)
814         .forever(){
815       exec(session => {
816         session.set("sPServer", idGenerator())
817       })
818       .exec(session => {
819         session.set("sVServer", idGenerator())
820       })
821       .exec(
822         http("BulkSingleTx2" + env)
823         .post("/aai/v22/bulk/single-transaction")
824         .body(ElFileBody("onapbulk-single-tx_putPServerVServer.json"))
825         .headers(httpHeaders)
826         .check(
827           status.find.in(201)
828         )
829       )
830         .pause(2,33)
831         .exec(
832           http("Vserver " + env)
833           .get("/aai/v22/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenantId1/vservers/vserver/${sVServer}?depth=0&nodes-only=true")
834           .headers(httpHeaders)
835           .check(
836             status.find.in(200)
837           )
838           .check(jsonPath("$.resource-version").saveAs("rsrcver"))
839         )
840         .exec(
841          http("Vserver  " + env)
842           .delete("/aai/v22/cloud-infrastructure/cloud-regions/cloud-region/onap-CROwner/onap-CRId/tenants/tenant/onap-tenantId1/vservers/vserver/${sVServer}?resource-version=${rsrcver}")
843           .headers(httpHeaders)
844
845           .check(status.find.in(204))
846         )
847         .exec(
848           http("Pserver " + env)
849           .get("/aai/v22/cloud-infrastructure/pservers/pserver/${sPServer}?depth=0&nodes-only=true")
850           .headers(httpHeaders)
851           .check(
852             status.find.in(200)
853           )
854           .check(jsonPath("$.resource-version").saveAs("rsrcver"))
855         )
856         .exec(
857          http("Pserver " + env)
858           .delete("/aai/v22/cloud-infrastructure/pservers/pserver/${sPServer}?resource-version=${rsrcver}")
859           .headers(httpHeaders)
860           .check(status.find.in(204))
861         )
862       .pause(1,9)
863     }
864
865      /***
866     *
867     * @param env
868     * Sends a patch request
869     */
870         def PostBulkSingleTx3(env: String) = scenario("BulkSingleTx3 " + env)
871     .forever(){
872       exec(session => {
873         session.set("CR1", idGenerator())
874       })
875       .exec(session => {
876         session.set("AZ1", idGenerator())
877       })
878                 .exec(session => {
879         session.set("flavor1", idGenerator())
880       })
881                 .exec(session => {
882         session.set("image1", idGenerator())
883       })
884                 .exec(session => {
885         session.set("complex1", idGenerator())
886       })
887                 .exec(session => {
888         session.set("pserver1", idGenerator())
889       })
890                 .exec(session => {
891         session.set("pserver2", idGenerator())
892       })
893                 .exec(session => {
894         session.set("pserver3", idGenerator())
895       })
896       .exec(
897         http("BulkSingleTx3 " + env)
898         .post("/aai/v21/bulk/single-transaction")
899         .body(ElFileBody("onap-patch-bulk-single-tx.json"))
900         .headers(httpHeaders)
901         .check(
902           status.find.in(201)
903         )
904       )
905       .pause(2,5)
906     }
907
908   /***
909     *
910     * @param env
911     * @CQ-pserver-zdevice1
912     */
913   def CQpserverzdevice1(env: String) = scenario("CQ pserverzdeviceresurldepth1 " + env)
914      .forever(){
915         exec(
916           http("CQ pserverzdeviceresurldepth1 " + env)
917           .put("/aai/v22/query?format=resource_and_url&depth=1")
918           .headers(httpHeaders)
919           .body(ElFileBody("onap-CQ-pserver-zdevice.json"))
920           .check(
921             status.find.in(200)
922           )
923         )
924         .pause(2,4)
925      }
926
927   /***
928     *
929     * @param env
930     * @CQ-pserver-zdevice2
931     */
932   def CQpserverzdevice2(env: String) = scenario("CQ pserverzdeviceres " + env)
933      .forever(){
934         exec(
935           http("CQ pserverzdeviceres " + env)
936           .put("/aai/v22/query?format=resource")
937           .headers(httpHeaders)
938           .body(ElFileBody("onap-CQ-pserver-zdevice.json"))
939           .check(
940             status.find.in(200)
941           )
942         )
943         .pause(2,4)
944      }
945
946   /***
947     *
948     * @param env
949     * @CQ-vlanrange-fromVlantag
950     */
951   def CQvlanrangefromVlantag(env: String) = scenario("CQ vlanrangefromVlantag " + env)
952      .forever(){
953         exec(
954           http("CQ vlanrangefromVlantag " + env)
955           .put("/aai/v22/query?format=resource")
956           .headers(httpHeaders)
957           .body(ElFileBody("onap-CQ-vlanrange-fromVlantag.json"))
958           .check(
959             status.find.in(200)
960           )
961         )
962         .pause(1,1)
963      }
964
965   /***
966     *
967     * @param env
968     * @CQ-getClfiRoadmTailSummary
969     */
970   def CQgetClfiRoadmTailSummary(env: String) = scenario("CQ getClfiRoadmTailSummary " + env)
971      .forever(){
972         exec(
973           http("CQ getClfiRoadmTailSummary " + env)
974           .put("/aai/v22/query?format=simple&nodesOnly=true")
975           .headers(httpHeaders)
976           .body(ElFileBody("onap-CQ-getClfiRoadmTailSummary.json"))
977           .check(
978             status.find.in(200)
979           )
980         )
981         .pause(1,1)
982      }
983
984   /***
985     *
986     * @param env
987     * @CQ-vrfs-fromVlantag
988     */
989   def CQvrfsfromVlantag(env: String) = scenario("CQ vrfsfromVlantag " + env)
990      .forever(){
991         exec(
992           http("CQ vrfsfromVlantag " + env)
993           .put("/aai/v22/query?format=resource")
994           .headers(httpHeaders)
995           .body(ElFileBody("onap-CQ-vrfs-fromVlantag.json"))
996           .check(
997             status.find.in(200)
998           )
999         )
1000         .pause(1,1)
1001      }
1002
1003   /***
1004     *
1005     * @param env
1006     * @CQ-genericVnfs-fromPserver
1007     */
1008   def CQgenericVnfsfromPserver(env: String) = scenario("CQ genericVnfsfromPserver " + env)
1009      .forever(){
1010         exec(
1011           http("CQ genericVnfsfromPserver " + env)
1012           .put("/aai/v22/query?format=resource&depth=0")
1013           .headers(httpHeaders)
1014           .body(ElFileBody("onap-CQ-genericVnfs-fromPserver.json"))
1015           .check(
1016             status.find.in(200)
1017           )
1018         )
1019         .pause(2,11)
1020      }
1021
1022   /***
1023     *
1024     * @param env
1025     * @CQ-zPnfs-fromPnf
1026     */
1027   def CQzPnfsfromPnf(env: String) = scenario("CQ zPnfsfromPnf " + env)
1028      .forever(){
1029         exec(
1030           http("CQ zPnfsfromPnf " + env)
1031           .put("/aai/v22/query?format=resource_and_url&depth=1")
1032           .headers(httpHeaders)
1033           .body(ElFileBody("onap-CQ-zPnfs-fromPnf.json"))
1034           .check(
1035             status.find.in(200)
1036           )
1037         )
1038         .pause(2,11)
1039      }
1040
1041     /***
1042     *
1043     * @param env
1044     * @DSL1
1045     */
1046  def DslQuery1(env: String) = scenario("DSL Query1 " + env)
1047     .forever(){
1048       exec(
1049         http("DSL Query1 PUT")
1050         .put("/aai/v21/dsl?format=resource")
1051         .headers(httpHeaders)
1052         .body(ElFileBody("onap-DSL1.json"))
1053         .check(
1054           status.find.in(200)
1055         )
1056       )
1057       .pause(2,3)
1058     }
1059
1060             /***
1061     *
1062     * @param env
1063     * @DSL2
1064     */
1065  def DslQuery2(env: String) = scenario("DSL Query2 " + env)
1066     .forever(){
1067       exec(
1068         http("DSL Query2 PUT")
1069         .put("/aai/v21/dsl?format=resource")
1070         .headers(httpHeaders)
1071         .body(ElFileBody("onap-DSL2.json"))
1072         .check(
1073           status.find.in(200)
1074         )
1075       )
1076       .pause(1,1)
1077     }
1078
1079             /***
1080     *
1081     * @param env
1082     * @DSL3
1083     */
1084  def DslQuery3(env: String) = scenario("DSL Query3 " + env)
1085     .forever(){
1086       exec(
1087         http("DSL Query3 PUT")
1088         .put("/aai/v21/dsl?format=resource")
1089         .headers(httpHeaders)
1090         .body(ElFileBody("onap-DSL3.json"))
1091         .check(
1092           status.find.in(200)
1093         )
1094       )
1095       .pause(2,4)
1096     }
1097
1098             /***
1099     *
1100     * @param env
1101     * @DSL4
1102     */
1103  def DslQuery4(env: String) = scenario("DSL Query4 " + env)
1104     .forever(){
1105       exec(
1106         http("DSL Query4 PUT")
1107         .put("/aai/v21/dsl?format=resource")
1108         .headers(httpHeaders)
1109         .body(ElFileBody("onap-DSL4.json"))
1110         .check(
1111           status.find.in(200)
1112         )
1113       )
1114       .pause(2,12)
1115     }
1116
1117             /***
1118     *
1119     * @param env
1120     * @DSL5
1121     */
1122  def DslQuery5(env: String) = scenario("DSL Query5 " + env)
1123     .forever(){
1124       exec(
1125         http("DSL Query5 PUT")
1126         .put("/aai/v21/dsl?format=resource")
1127         .headers(httpHeaders)
1128         .body(ElFileBody("onap-DSL5.json"))
1129         .check(
1130           status.find.in(200)
1131         )
1132       )
1133       .pause(2,13)
1134     }
1135
1136             /***
1137     *
1138     * @param env
1139     * @DSL6
1140     */
1141  def DslQuery6(env: String) = scenario("DSL Query6 " + env)
1142     .forever(){
1143       exec(
1144         http("DSL Query6 PUT")
1145         .put("/aai/v21/dsl?format=resource")
1146         .headers(httpHeaders)
1147         .body(ElFileBody("onap-DSL6.json"))
1148         .check(
1149           status.find.in(200)
1150         )
1151       )
1152       .pause(2,14)
1153     }
1154
1155             /***
1156     *
1157     * @param env
1158     * @DSL7
1159     */
1160  def DslQuery7(env: String) = scenario("DSL Query7 " + env)
1161     .forever(){
1162       exec(
1163         http("DSL Query7 PUT")
1164         .put("/aai/v21/dsl?format=resource")
1165         .headers(httpHeaders)
1166         .body(ElFileBody("onap-DSL7.json"))
1167         .check(
1168           status.find.in(200)
1169         )
1170       )
1171       .pause(2,19)
1172     }
1173
1174             /***
1175     *
1176     * @param env
1177     * @DSL8
1178     */
1179  def DslQuery8(env: String) = scenario("DSL Query8 " + env)
1180     .forever(){
1181       exec(
1182         http("DSL Query8 PUT")
1183         .put("/aai/v21/dsl?format=resource")
1184         .headers(httpHeaders)
1185         .body(ElFileBody("onap-DSL8.json"))
1186         .check(
1187           status.find.in(200)
1188         )
1189       )
1190       .pause(2,9)
1191     }
1192
1193             /***
1194     *
1195     * @param env
1196     * @DSL9
1197     */
1198  def DslQuery9(env: String) = scenario("DSL Query9 " + env)
1199     .forever(){
1200       exec(
1201         http("DSL Query9 PUT")
1202         .put("/aai/v21/dsl?format=resource")
1203         .headers(httpHeaders)
1204         .body(ElFileBody("onap-DSL9.json"))
1205         .check(
1206           status.find.in(200)
1207         )
1208       )
1209       .pause(2,7)
1210     }
1211
1212             /***
1213     *
1214     * @param env
1215     * @DSL10
1216     */
1217  def DslQuery10(env: String) = scenario("DSL Query10 " + env)
1218     .forever(){
1219       exec(
1220         http("DSL Query10 PUT")
1221         .put("/aai/v21/dsl?format=resource")
1222         .headers(httpHeaders)
1223         .headers(Map(
1224           "X-DslApiVersion"-> """V2"""
1225         ))
1226         .body(ElFileBody("onap-DSL10.json"))
1227         .check(
1228           status.find.in(200)
1229         )
1230       )
1231       .pause(2,32)
1232     }
1233
1234
1235   /***
1236     *
1237     * @param env
1238     * @Does a Search NodesQuery request
1239     */
1240   def SearchNodesQuery(env: String) = scenario("GET VNF Search Nodes Query " + env)
1241     .forever(){
1242        exec(
1243         http("GET VNF Search Nodes Query " + env)
1244         .get("/aai/v23/search/nodes-query?search-node-type=generic-vnf&filter=vnf-name:EQUALS:onap-genericvnfname")
1245         .headers(httpHeaders)
1246         .headers(Map(
1247           "X-FromAppId"-> """ONAP-fromappId"""
1248         ))
1249         .check(
1250           status.find.in(200)
1251         )
1252       )
1253     .pause(2,36)
1254     }
1255
1256
1257   setUp(
1258       PutTenant("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1259 PatchTenant("ePerf02").inject(atOnceUsers(23)).protocols(http.baseURL("Enter Host with Port")),
1260 GetTenant("ePerf02").inject(atOnceUsers(7)).protocols(http.baseURL("Enter Host with Port")),
1261 DeleteTenant("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1262 Getvserver1("ePerf02").inject(atOnceUsers(4)).protocols(http.baseURL("Enter Host with Port")),
1263 GetVFModule1("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1264 Getvserver2("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1265 GetSI1("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1266 GetVNF1("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1267 GetVNF2("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1268 GetPserver1("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1269 Getvolumegroup("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1270 Getplatform("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1271 Getsriovvf1("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1272 Getpnf1("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1273 Getvnfc1("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1274 Getvlan("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1275 GetSI2("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1276 GetPserver2("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1277 Getconfiguration("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1278 Getservicesubscription("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1279 Getpnf2("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1280 Getcustomer("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1281 Getowningentity("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1282 Getvnfc2("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1283 Getvlantag("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1284 Getproject("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1285 Getlob("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1286 Getsriovvf2("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1287 Getsnapshot("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1288 Getvolume("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1289 GetCR("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1290 PUTvfmodule("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1291 Getallservices("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1292 PostBulkSingleTx1("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1293 PostBulkSingleTx2("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1294 PostBulkSingleTx3("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1295 CQpserverzdevice1("ePerf02").inject(atOnceUsers(4)).protocols(http.baseURL("Enter Host with Port")),
1296 CQpserverzdevice2("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1297 CQvlanrangefromVlantag("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1298 CQgetClfiRoadmTailSummary("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1299 CQvrfsfromVlantag("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1300 CQgenericVnfsfromPserver("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1301 CQzPnfsfromPnf("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1302 DslQuery1("ePerf02").inject(atOnceUsers(2)).protocols(http.baseURL("Enter Host with Port")),
1303 DslQuery2("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1304 DslQuery3("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1305 DslQuery4("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1306 DslQuery5("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1307 DslQuery6("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1308 DslQuery7("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1309 DslQuery8("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1310 DslQuery9("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1311 DslQuery10("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port")),
1312 SearchNodesQuery("ePerf02").inject(atOnceUsers(1)).protocols(http.baseURL("Enter Host with Port"))
1313
1314   ).maxDuration(10 minutes)
1315 }