diff options
Diffstat (limited to 'nokia/vnfmdriver/vfcadaptorservice')
43 files changed, 1150 insertions, 349 deletions
diff --git a/nokia/vnfmdriver/vfcadaptorservice/deployment/src/main/release/etc/vnfpkginfo/cbam_extension.json b/nokia/vnfmdriver/vfcadaptorservice/deployment/src/main/release/etc/vnfpkginfo/cbam_extension.json new file mode 100644 index 00000000..ed0f3c36 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/deployment/src/main/release/etc/vnfpkginfo/cbam_extension.json @@ -0,0 +1,220 @@ +{ + "extensions": [ + { + "name": "cscf_names_second_of_pair", + "value": [ + "cscf02" + ] + }, + { + "name": "cscf_uuids_second_of_pair", + "value": [ + "Xs7cW9I9" + ] + }, + { + "name": "cakey", + "value": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURGakNDQWY2Z0F3SUJBZ0lEQVYwbk1BMEdDU3FHU0liM0RRRUJDd1VBTUJZeEZEQVNCZ05WQkFNVEN6RTMKTWk0ek1DNHlOQzQyTUI0WERURTNNRGt4T1RBME1EZ3dNVm9YRFRJM01Ea3hOekEwTURnd01Wb3dGakVVTUJJRwpBMVVFQXhNTE1UY3lMak13TGpJMExqWXdnZ0VnTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCRFFBd2dnRUlBb0lCCkFRRFFOUXVlVzNqSXl6VjNKeXN6L2RhZmNpcWg3ZTdPeFh3RzNYOVBhUnh5NTRGM1l0cEhxbExOMjkrWEVxTHEKcnhaYy9CL0p1S3dyNDlYRkRBMWlsTkFLblM2dHgwbStIaWFoNUh3dXRhS1Q1T2NhdStmc1VtUnNuRXZjTlNoTApEQkxBeWpWZDhKY3owNk9mMjNXWkF1Qjg0eXN4aWQ3amg0NW1XOGFnODN3TGoxZC9pbDllaGhQRmcyUXkvWVE4CmRjaGJjeWphMVpQd2hueS9HVXQ5dEoxVHd1bnRHS1poRVNjWnRiMzYyeG9MRHhrSHQ4aDMrR1A3bWprbEswbGkKSy9MZVU3cGsyc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ejRPTE5VLy9RekNJVGpkcGVMdDRaenNJVkNDMQovVXF1QUZNK21IczZML2dMZVBybEVINm4vSWszVjVJNDZkdVVROFB3M09razZwazBLUHZGWlFyVVFVaW1UbDd6ClVkQ3Yrc3ZjR1A5bVpWWHBoWEJUTU9MNmdQV3F4dGdEclhqYWxaaDExZnpRTnNvNEhZYjVEdmQ4eitHYWlmTm4KVjN5THlhSWlqSTV4N0NKdnRBQ3BGdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" + }, + { + "name": "cscf_uuids_first_of_pair", + "value": [ + "Ip9xC0J4" + ] + }, + { + "name": "oam_volume_size", + "value": 300 + }, + { + "name": "internal_network_cidr", + "value": "192.168.101.0/24" + }, + { + "name": "internal_network_ipversion", + "value": 4 + }, + { + "name": "lb_internal_cipa_ip", + "value": "192.168.101.32" + }, + { + "name": "oam03_privkey", + "value": "LS0tLS1CRUdJTiBFTkNSWVBURUQgUFJJVkFURSBLRVktLS0tLQpNSUlGSHpCSkJna3Foa2lHOXcwQkJRMHdQREFiQmdrcWhraUc5dzBCQlF3d0RnUUk1UElJODBXR04vY0NBZ2dBCk1CMEdDV0NHU0FGbEF3UUJLZ1FRWVNDSSs5QSs4bWVVcFBOVjAxbFVmQVNDQk5DZUxwYnJNZzlYRENweDB2V0gKNTF3SVdTdG0xR01RWUh2eFE3KytOVGJlaHV6MjFIcklmY0tqaEEwREdyaTcwbkJzWWQ5UlZqZEVwazhpNnNhRApQeldjL2J5U1p3dHh3N2U2em5lbUc5VExXVE1MNWZoclpZUGkvMFh4TG02NnM3MElkS0o4MWQ5eHBubnJKZUpqCjExVkxIMTBEaE9NdTNScDhLeTE3dXNFVjdQZDBQeUNRZ3dTTU8rT0orbXFLRFR3K2o1OWp2UzBNTEFRT3hhU20KTkFIQUJoTWpTN21ldTVPeERIb3M3aHNnbXpIbnhNajJrUzNrMC8rajlzMFZ5elY1U3Nab1NHRlF3ZTlaUlVoRwpPTzNOVzhqdHk4ZXdiS3k1W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84UU83SFJBa3lubU8wS0ZhMGVWY3E5ZFNGb1g3NjNLCjZud2tGSWd0MVo4b2UxVDJ3NGNIZUxqSnY5OHY5VXo3R1NKYkVvQVN4b3B0NXdQTS9VMWtrNVJxZHdUMWp1MTkKRXhpWDRTUUo1dDdhRDlUNGpaZUVseTQyVy9FdGl6WnhiM0laZlZZWlMrbWpVem0ybkR6NStUOHNIUFI4WVV2UAp0MlRZNG9YTzVuNTBwUk13bnJnZ0RIVm41aEFMZVhFcFkyOFZ0dDhEaXY0VXVJa294djlGR25JUlhYWWlkdUliCkZUOC93RDgwQlhxSG9Ed0xIdTh0SktiU2tuNWhDVnQ5ZXZzUFJvME8xcFI1c25EL0E2aXJFU3lEaXJKVW5kMXQKQ1lmNGpHWFpnclphK1VDTmhiTUpNYkU0WHA2ZnFXZklEQSt3ZlovbkJoRkNhNXRUcWdjY241dGQ2WWNpUXN0agpLM0t6M2tyeFNEMWJINExzZ1V6bWZ4VnNzNjFpYVEvNnVzM00zR0N6ajc3S3ZnSnhsRHFWbWs0Z01hWHJHUXhGCnlETXd0Q05qRllKMUJrSEU2RHNGcndvSFFpdVFoTnB2bEtXQ2JtWWpndmpBdWpvMFdONlZGWC9HSVVMTGhoWnoKU2NWZHZpUEY3VWtxY05zR1lSczhIVkhLWXZUZ2RnLzJObVFHSm5mMGV6dWFaUlZWUXVnZU9wOW5Nd0w0MkU2NApFSEREdXpUckpLTWF5NjFZVmFybFNCRWxXQT09Ci0tLS0tRU5EIEVOQ1JZUFRFRCBQUklWQVRFIEtFWS0tLS0tCg==" + }, + { + "name": "lb02_name", + "value": "lb02" + }, + { + "name": "lb02_internal_ip", + "value": "192.168.101.2" + }, + { + "name": "cscf_internal_ips_first_of_pair", + "value": [ + "192.168.101.4" + ] + }, + { + "name": "swrepo_ip", + "value": "172.30.24.6" + }, + { + "name": "internal_netmask", + "value": "255.255.255.0" + }, + { + "name": "cmrepo_ip", + "value": "172.30.24.6,172.30.24.7" + }, + { + "name": "oam01_name", + "value": "oam01" + }, + { + "name": "oam03_uuid", + "value": "Df4tI1S7" + }, + { + "name": "oam01_internal_ip", + "value": "192.168.101.7" + }, + { + "name": "oam02_name", + "value": "oam02" + }, + { + "name": "oam03_name", + "value": "oam03" + }, + { + "name": "dn", + "value": "CSCFDN" + }, + { + "name": "oam02_tempkey", + "value": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURERENDQWZTZ0F3SUJBZ0lFSW5pRGhUQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRREV3c3gKTnpJdU16QXVNalF1TmpBZUZ3MHhOekV4TURZd05qUTFNVGhhRncweE56RXhNRGN3TmpRMU1UaGFNRHN4RlRBVApCZ05WQkFNVERERTNNaTR6TUM0eU5DNHlNakVTTUJBR0ExVUVCeE1KUW1GdVoyRnNiM0psTVE0d0RBWURWUVFLCkV3Vk9UMHRKUVRDQ0FTQXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRU5BRENDQVFnQ2dnRUJBTUNqWHUrdkFkUUgKNjMyRTdOUkRaRU1jN1lQRE5mSWpGZkd1a2szRVIzMnFjWnVRV1JZQVdSK0V4L2lzd1BMSFMzRHRabWxqWnlpLwp6aXlkNGVVT0VBZkh5eHZSNm4vK1hCN1F6eExkL3JhNWYyaUhWb0gyZ3lmWmpZV2ljSDRZSjdSMVM4NVpLWk9ZCkpWNHZiblhFL2lCVThvckNWZGw4OGFta01Lc3EvQVhmQ3BmRitJU2hITEVIeXRsbFpraXZkWTNrU0lUQmtXWDcKUDY4djV4YlhrdGhBcm1aV2ZOZDR3eVB3bHh5bnBKWm5JdFlzR3Y4RzdxOUx5WitpWjJIaUtjbFhNY0VyTmtjcgpDcElQN2JwVW94KzQxditmNlRaOG44Z2VZaUZxZkR4SUhNMUtISHRsVm10RWltM1RlM05CMi9kSGQ3N1I2UFpuCkdEUzJCZCsvbWpNQ0FRT2pQekE5TUE4R0ExVWRFUVFJTUFhSEJLd2VHQll3Q3dZ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, + { + "name": "default_gateway", + "value": "172.30.24.1" + }, + { + "name": "oam02_internal_ip", + "value": "192.168.101.8" + }, + { + "name": "oam02_privkey", + "value": "LS0tLS1CRUdJTiBFTkNSWVBURUQgUFJJVkFURSBLRVktLS0tLQpNSUlGSHpCSkJna3Foa2lHOXcwQkJRMHdQREFiQmdrcWhraUc5dzBCQlF3d0RnUUlxS1R3cFV6Vlg2b0NBZ2dBCk1CMEdDV0NHU0FGbEF3UUJLZ1FRMHBrQUtLdzRNMTRBbWM5QkN1M1BRUVNDQk5BbktZajNjY1BPZ3djOVdVeFEKT05xT2FLMDNNbm54TWxkREhDdnJuNE9ZTC8wcG1BekZ1dUp1dDRzeUJkSlNtUTBKU0JMMkNNalQ0NHljZWF1VgpZTXF3Y2dOd0pQdU9GUHlyVDlRdUdBNkdKdXlPRCtaaThFMFBiU3d6MGkwNGtWYksvMlVKNi9yMHFkdFJzWXlDCmJURWw0Um1vbjR1bUlyeG1ieWVjSjZmYkkxOWYzWU9VQnpnc3FTY1NUMXhZcm5uMjd4dk41bmdqYTV5ZlFuaWgKWllTRzhSWU1EODM0bWVYMERMU1E4dnVxbTZmMXVNN3dQd0pnZEhPcDJDNXpoR08ySlIxYUM2K1dlMjV2RUs5dQpzb3lzTVZBK1A3NTgxTTFzSDJHWmx0RElKcUtCWXZzZEo1TCtTSTFQM1kxSFhob2w2eHFwME5UdG4rRFh2N1FPCm5jUXM0WDcwQnVWY0JXaEltZWdFVjJPTGNzN3JPZ0JlWnhPaVErYlZaUkZDRkYyOVBPYTlPWHhXQmQzZEw5TXEKUzBzNStrcEU3T3QrRWRxVUlzVlFNNGVodUJvWTh1U2ZrUldJbzJSREVPVDdWNVpaNit0VWxHZHpUUjZYWTk4VApEcVZWNlRnU0MydVpwLzVHQXptbS83ZVBzb2JESkk1SnVMVU1PY21QWWp6bmRWTTZkcWtheWF3MWFIQWNwbmlpCndQR3NGa1NEdFJGUVBEZkRhZDNiUjdGcUdiNUtKazBxK1dvbGE3Vk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WmJjcmFvQmhnbkQ1N2Zac2IKT0tpVmVGeFY3ak4xVnZIOVNtSG5EVmlGdlVqSVVJQ1k1R0EvM3VYaWJlOExwNUIzc3k1TEVVbCsrZS9nbHhzbQowRGtNYnR4WE1LbmFycVh0amJPSkFUb1ZZUFpTRlVVbzB6KytqVTV6SEZlNUtTVENuVDF6anlOejNZTUlwa2NyCjc0czZSQytGL1Y1ZDViekFYbm9oNkx6Uk1wU1RZKzl6VlRXRDhOM0RXMUhjNDdLQjBBejJwSWRoL3ppOVVSWWcKczV6VHRlYWVNenFwaUxFcjZzaGNRK0FGSlRjR0Zkd1ZNMXlpVTRReGx2UWwwdlJpb20zVnZZajZCZldvQkRNVAo5UWVBV1h0WlJRZ3NMdlkrV0hReFFHdDRhdz09Ci0tLS0tRU5EIEVOQ1JZUFRFRCBQUklWQVRFIEtFWS0tLS0tCg==" + }, + { + "name": "lb_vnic_count", + "value": 5 + }, + { + "name": "vnf_name", + "value": "vCSCF" + }, + { + "name": "oam03_internal_ip", + "value": "192.168.101.9" + }, + { + "name": "oam01_uuid", + "value": "Bx6gW3N6" + }, + { + "name": "oam_internal_cipa_ip", + "value": "192.168.101.3" + }, + { + "name": "du", + "value": "CSCFDU_DUSpec" + }, + { + "name": "oam_cipa_ip", + "value": "172.30.24.20" + }, + { + "name": "lb01_uuid", + "value": "Vk0tN3Z7" + }, + { + "name": "storage_availability_zone1", + "value": "nova" + }, + { + "name": "lb01_internal_ip", + "value": "192.168.101.1" + }, + { + "name": "storage_availability_zone2", + "value": "nova" + }, + { + "name": "volume_type", + "value": "nokia_volume" + }, + { + "name": "mtu", + "value": "1500" + }, + { + "name": "cscf_internal_ips_second_of_pair", + "value": [ + "192.168.101.5" + ] + }, + { + "name": "oam03_tempkey", + "value": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURERENDQWZTZ0F3SUJBZ0lFRUdKcXl6QU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRE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Y1dUoyd2JoN2d2YnJMWUMzWE5GQlZaeUZRZUlFai9jZ0p4YWRRQ2NKKzUwa2NtOExHWnV2WnVNRwpnMURyZGVpcW9PMkZORFlveDBLV2ZHR2F3NUxJSmp2YXlNWU1jbzZ0bmQ2UmgvcnFFd09yY2UrbjUvUGsycmkzCitFWE14dkVLTkJIQ0VTL2NyS1VwOUx4aTZEMlZJSVRrYkNKK2FyS1JyWnRLWC91T3lmUUhqSEdlUnEvKzlzcVAKRmhHOFFMK3NrRktRTVh4YVZnNXJLUT09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" + }, + { + "name": "lb02_uuid", + "value": "Xt5iP3V9" + }, + { + "name": "oam02_uuid", + "value": "Cr7nU4V4" + }, + { + "name": "release", + "value": "17.5" + }, + { + "name": "cscf_names_first_of_pair", + "value": [ + "cscf01" + ] + }, + { + "name": "oam_netmask", + "value": "255.255.255.0" + }, + { + "name": "aif", + "value": "no" + }, + { + "name": "lb_volume_size", + "value": 300 + } + ] +}
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/deployment/src/main/release/etc/vnfpkginfo/cbam_input.json b/nokia/vnfmdriver/vfcadaptorservice/deployment/src/main/release/etc/vnfpkginfo/cbam_input.json new file mode 100644 index 00000000..d068bf0e --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/deployment/src/main/release/etc/vnfpkginfo/cbam_input.json @@ -0,0 +1,179 @@ +{ + "zones": [ + { + "resourceId": "nova", + "id": "zoneInfoId1" + }, + { + "resourceId": "nova", + "id": "zoneInfoId2" + } + ], + "extVirtualLinks": [ + { + "resourceId": "NOKIA_IMS_02", + "extCps": [ + { + "cpdId": "lbCpdeth3", + "addresses": [ + { + "ip": "10.8.10.35" + }, + { + "ip": "10.8.10.36" + } + ] + }, + { + "cpdId": "lbMovingCpdeth3", + "addresses": [ + { + "ip": "10.8.10.34" + } + ] + } + ] + }, + { + "resourceId": "NOKIA_IMS_01", + "extCps": [ + { + "cpdId": "lbCpdeth2", + "addresses": [ + { + "ip": "10.8.10.8" + }, + { + "ip": "10.8.10.9" + } + ] + }, + { + "cpdId": "lbMovingCpdeth2", + "addresses": [ + { + "ip": "10.8.10.6" + }, + { + "ip": "10.8.10.7" + } + ] + } + ] + }, + { + "resourceId": "oam-nokia", + "extCps": [ + { + "cpdId": "oamCpdeth1", + "addresses": [ + { + "ip": "172.30.24.21" + }, + { + "ip": "172.30.24.22" + }, + { + "ip": "172.30.24.23" + } + ] + }, + { + "cpdId": "oamMovingCpdeth1", + "addresses": [ + { + "ip": "172.30.24.20" + } + ] + }, + { + "cpdId": "lbCpdeth1", + "addresses": [ + { + "ip": "172.30.24.18" + }, + { + "ip": "172.30.24.19" + } + ] + }, + { + "cpdId": "lbMovingCpdeth1", + "addresses": [ + { + "ip": "172.30.24.17" + } + ] + } + ] + }, + { + "resourceId": "NOKIA_IMS_03", + "extCps": [ + { + "cpdId": "lbCpdeth4", + "addresses": [ + { + "ip": "10.8.10.67" + }, + { + "ip": "10.8.10.68" + } + ] + }, + { + "cpdId": "lbMovingCpdeth4", + "addresses": [ + { + "ip": "10.8.10.66" + } + ] + } + ] + } + ], + "vims": [ + { + "interfaceInfo": { + "region": "RegionOne" + }, + "interfaceEndpoint": "http://172.30.1.2:5000/v3", + "accessInfo": { + "username": "nokiaonap", + "password": "nokia1234!", + "tenant": "Nokia_IMS" + }, + "id": "os" + } + ], + "grantlessMode": true, + "softwareImages": [ + { + "vnfdSoftwareImageId": "cscfImage", + "resourceId": "NOKIA-CSCF" + }, + { + "vnfdSoftwareImageId": "oamImage", + "resourceId": "NOKIA-OAM" + } + ], + "additionalParams": { + "aif": "no" + }, + "computeResourceFlavours": [ + { + "resourceId": "NOKIA_CSCF_FLAVOR", + "vnfdVirtualComputeDescId": "cscfCompute" + }, + { + "resourceId": "NOKIA_LB_FLAVOR", + "vnfdVirtualComputeDescId": "lbCompute" + }, + { + "resourceId": "NOKIA_OAM_FLAVOR", + "vnfdVirtualComputeDescId": "oamCompute" + } + ], + "flavourId": "cscf_si1", + "instantiationLevelId": "basic" +}
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java index 55448096..aebf122e 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/Driver2CbamRequestConverter.java @@ -16,27 +16,20 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.adaptor; -import java.util.ArrayList; -import java.util.List; +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMCreateVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfRequest; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.EndpointInfo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ExtVirtualLinkData; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OpenStackAccessInfoV2; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OpenStackAccessInfoV3; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OpenstackV2Info; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OpenstackV3Info; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OtherVimInfo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VCloudAccessInfo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VimInfo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VimInfoType; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VmwareVcloudInfo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VnfExtCpData; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.util.CommonUtil; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.ScaleDirection; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.ScaleType; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.GrantInfo; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VimComputeResourceFlavour; @@ -46,134 +39,36 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest; import org.springframework.stereotype.Component; +import com.google.gson.Gson; + @Component public class Driver2CbamRequestConverter { - + public CBAMCreateVnfRequest createReqConvert(InstantiateVnfRequest driverRequest) { CBAMCreateVnfRequest request = new CBAMCreateVnfRequest(); - request.setVnfdId(driverRequest.getVnfDescriptorId()); + request.setVnfdId(driverRequest.getVnfdId()); request.setName(driverRequest.getVnfInstanceName()); request.setDescription(driverRequest.getVnfInstanceDescription()); return request; } - public CBAMInstantiateVnfRequest InstantiateReqConvert(InstantiateVnfRequest driverRequest, - NslcmGrantVnfResponse nslc, GrantInfo grant, VimComputeResourceFlavour vimco) { - CBAMInstantiateVnfRequest request = new CBAMInstantiateVnfRequest(); + public CBAMInstantiateVnfRequest instantiateRequestConvert(InstantiateVnfRequest driverRequest, + NslcmGrantVnfResponse nslc, GrantInfo grant, VimComputeResourceFlavour vimco) throws Exception { + Gson gson = new Gson(); + String inputJson = readcbamInputInfoFromJsonFile(); + CBAMInstantiateVnfRequest request = gson.fromJson(inputJson, CBAMInstantiateVnfRequest.class); - List<VimInfo> vims = new ArrayList<VimInfo>(); - VimInfo vim = new VimInfo(); - EndpointInfo inter = new EndpointInfo(); - List<ExtVirtualLinkData> list = new ArrayList<ExtVirtualLinkData>(); - ExtVirtualLinkData ext = new ExtVirtualLinkData(); - List<VnfExtCpData> cps = new ArrayList<VnfExtCpData>(); - VnfExtCpData cp = new VnfExtCpData(); - OpenStackAccessInfoV3 v3 = new OpenStackAccessInfoV3(); - OpenStackAccessInfoV2 v2 = new OpenStackAccessInfoV2(); - VCloudAccessInfo vcloudInfo = new VCloudAccessInfo(); - if(vim.getVimInfoType().equals(VimInfoType.OPENSTACK_V2_INFO)) { - OpenstackV2Info openstackV2=new OpenstackV2Info(); - List<org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ExtVirtualLinkData> link=driverRequest.getExtVirtualLink(); - for(int i=0;i<link.size();i++) { - vim.setId(link.get(i).getVim().getVimId()); - inter.setEndpoint(link.get(i).getVim().getInterfaceEndpoint()); - openstackV2.setId(link.get(i).getVim().getVimId()); - openstackV2.setInterfaceInfo(inter); - - ext.setResourceId(link.get(i).getNetworkId());// todo resourceId - - cp.setCpdId(link.get(i).getCpdId()); - cps.add(cp); - ext.setExtCps(cps); - - List<org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.AccessInfo> accessInfo=link.get(i).getVim().getAccessInfo(); - for(int j=0;j<=accessInfo.size();j++) { - v2.setUsername(accessInfo.get(j).getUsername()); - v2.setPassword(accessInfo.get(j).getPassword()); - v2.setTenant(accessInfo.get(j).getTenant()); - //todo region - } - openstackV2.setAccessInfo(v2); - vims.add(vim); - list.add(ext); - } - }else if(vim.getVimInfoType().equals(VimInfoType.OPENSTACK_V3_INFO)) { - OpenstackV3Info openstackV3=new OpenstackV3Info(); - List<org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ExtVirtualLinkData> link=driverRequest.getExtVirtualLink(); - for(int i=0;i<link.size();i++) { - vim.setId(link.get(i).getVim().getVimId()); - inter.setEndpoint(link.get(i).getVim().getInterfaceEndpoint()); - openstackV3.setId(link.get(i).getVim().getVimId()); - openstackV3.setInterfaceInfo(inter); - - ext.setResourceId(link.get(i).getNetworkId());// todo resourceId - - cp.setCpdId(link.get(i).getCpdId()); - cps.add(cp); - ext.setExtCps(cps); - - List<org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.AccessInfo> accessInfo=link.get(i).getVim().getAccessInfo(); - for(int j=0;j<=accessInfo.size();j++) { - v3.setUsername(accessInfo.get(j).getUsername()); - v3.setPassword(accessInfo.get(j).getPassword()); - //todo region project domain - } - openstackV3.setAccessInfo(v3); - vims.add(vim); - list.add(ext); - } - - }else if(vim.getVimInfoType().equals(VimInfoType.OTHER_VIM_INFO)) { - OtherVimInfo other=new OtherVimInfo(); - List<org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ExtVirtualLinkData> link=driverRequest.getExtVirtualLink(); - for(int i=0;i<link.size();i++) { - vim.setId(link.get(i).getVim().getVimId()); - inter.setEndpoint(link.get(i).getVim().getInterfaceEndpoint()); - other.setId(link.get(i).getVim().getVimId()); - - ext.setResourceId(link.get(i).getNetworkId());// todo resourceId - - cp.setCpdId(link.get(i).getCpdId()); - cps.add(cp); - ext.setExtCps(cps); - vims.add(vim); - list.add(ext); - } - - }else if(vim.getVimInfoType().equals(VimInfoType.VMWARE_VCLOUD_INFO)) { - VmwareVcloudInfo vcloud=new VmwareVcloudInfo(); - List<org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.ExtVirtualLinkData> link=driverRequest.getExtVirtualLink(); - for(int i=0;i<link.size();i++) { - vim.setId(link.get(i).getVim().getVimId()); - inter.setEndpoint(link.get(i).getVim().getInterfaceEndpoint()); - vcloud.setId(link.get(i).getVim().getVimId()); - vcloud.setInterfaceInfo(inter); - - ext.setResourceId(link.get(i).getNetworkId());// todo resourceId - - cp.setCpdId(link.get(i).getCpdId()); - cps.add(cp); - ext.setExtCps(cps); - - - List<org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.AccessInfo> accessInfo=link.get(i).getVim().getAccessInfo(); - for(int j=0;j<=accessInfo.size();j++) { - vcloudInfo.setUsername(accessInfo.get(j).getUsername()); - vcloudInfo.setPassword(accessInfo.get(j).getPassword()); - } - vcloud.setAccessInfo(vcloudInfo); - vims.add(vim); - list.add(ext); - } - - } - request.setFlavourId(driverRequest.getFlavourId()); - request.setVims(vims); - request.setExtVirtualLinks(list); return request; } + private String readcbamInputInfoFromJsonFile() throws IOException { + String filePath = "/etc/vnfpkginfo/cbam_input.json"; + String fileContent = CommonUtil.getJsonStrFromFile(filePath); + + return fileContent; + } + public CBAMTerminateVnfRequest terminateReqConvert(TerminateVnfRequest driverRequest) { CBAMTerminateVnfRequest request = new CBAMTerminateVnfRequest(); request.setTerminationType(driverRequest.getTerminationType()); @@ -190,10 +85,10 @@ public class Driver2CbamRequestConverter { public CBAMScaleVnfRequest scaleReqconvert(ScaleVnfRequest driverRequest) { CBAMScaleVnfRequest request = new CBAMScaleVnfRequest(); - if (driverRequest.getType().equals("SCALE_OUT")) { - request.setType(CommonEnum.ScaleDirection.OUT); + if (driverRequest.getType().equals(ScaleType.SCALE_OUT)) { + request.setType(ScaleDirection.OUT); } else { - request.setType(CommonEnum.ScaleDirection.IN); + request.setType(ScaleDirection.IN); } request.setAspectId(driverRequest.getAspectId()); request.setNumberOfSteps(driverRequest.getNumberOfSteps()); diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java index 6fbb028a..20c8bf50 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/InstantiateVnfContinueRunnable.java @@ -16,18 +16,18 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.adaptor; -import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Executors; -import org.apache.http.client.ClientProtocolException; import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.bo.entity.VnfPackageInfo; import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.inf.CatalogMgmrInf; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMModifyVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.util.CommonUtil; import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants; import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum.LifecycleOperation; @@ -35,14 +35,15 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean.VnfmJobExecutionInfo; import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository.VnfmJobExecutionRepository; import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpClientProcessorImpl; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfRequest; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmNotifyLCMEventsRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.AddResource; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.ResourceDefinition; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf; import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.zeroturnaround.zip.ZipUtil; + +import com.google.gson.Gson; public class InstantiateVnfContinueRunnable implements Runnable { @@ -54,12 +55,15 @@ public class InstantiateVnfContinueRunnable implements Runnable { private InstantiateVnfRequest driverRequest; private String vnfInstanceId; private String jobId; + private String vnfmId; private VnfmJobExecutionRepository jobDbMgmr; private Driver2CbamRequestConverter requestConverter; - public InstantiateVnfContinueRunnable(InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId, + private Gson gson = new Gson(); + + public InstantiateVnfContinueRunnable(String vnfmId, InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CatalogMgmrInf catalogMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository dbManager) { this.driverRequest = driverRequest; @@ -70,30 +74,66 @@ public class InstantiateVnfContinueRunnable implements Runnable { this.cbamMgmr = cbamMgmr; this.requestConverter = requestConverter; this.jobDbMgmr = dbManager; + this.vnfmId = vnfmId; } public void run() { + //step 1 handle vnf package + handleVnfPackage(); + + handleGrant(); + + handleModify(); try { - //step 1 handle vnf package - handleVnfPackage(); - - NslcmGrantVnfRequest grantRequest = buildNslcmGrantVnfRequest(); - NslcmGrantVnfResponse grantResponse = nslcmMgmr.grantVnf(grantRequest); - //step 5: instantiate vnf - CBAMInstantiateVnfRequest instantiateReq = requestConverter.InstantiateReqConvert(driverRequest, grantResponse, null, null); - CBAMInstantiateVnfResponse cbamInstantiateResponse = cbamMgmr.instantiateVnf(instantiateReq, vnfInstanceId); - handleCbamInstantiateResponse(cbamInstantiateResponse, jobId); + CBAMInstantiateVnfResponse cbamInstantiateResponse = handleInstantiate(); + handleNotify(cbamInstantiateResponse); + } catch (Exception e) { + logger.error("InstantiateVnfContinueRunnable --> handleInstantiate or handleNotify error.", e); + } + } + + private void handleNotify(CBAMInstantiateVnfResponse cbamInstantiateResponse) { + try { NslcmNotifyLCMEventsRequest nslcmNotifyReq = buildNslcmNotifyLCMEventsRequest(cbamInstantiateResponse); - nslcmMgmr.notifyVnf(nslcmNotifyReq, vnfInstanceId); - - } catch (ClientProtocolException e) { - logger.error("InstantiateVnfContinueRunnable run error ClientProtocolException", e); - } catch (IOException e) { - logger.error("InstantiateVnfContinueRunnable run error IOException", e); + nslcmMgmr.notifyVnf(nslcmNotifyReq, vnfmId, vnfInstanceId); + } catch (Exception e) { + logger.error("InstantiateVnfContinueRunnable --> handleNotify error.", e); + } + } + + private CBAMInstantiateVnfResponse handleInstantiate() throws Exception { + CBAMInstantiateVnfRequest instantiateReq = requestConverter.instantiateRequestConvert(driverRequest, null, null, null); + CBAMInstantiateVnfResponse cbamInstantiateResponse = cbamMgmr.instantiateVnf(instantiateReq, vnfInstanceId); + handleCbamInstantiateResponse(cbamInstantiateResponse, jobId); + return cbamInstantiateResponse; + } + + private void handleModify() { + try { + CBAMModifyVnfRequest modifyReq = generateModifyVnfRequest(); + cbamMgmr.modifyVnf(modifyReq, vnfInstanceId); + } catch (Exception e) { + logger.error("InstantiateVnfContinueRunnable --> handleModify error.", e); + } + } + + private void handleGrant(){ + try { + NslcmGrantVnfRequest grantRequest = buildNslcmGrantVnfRequest(); + nslcmMgmr.grantVnf(grantRequest); + } catch (Exception e) { + logger.error("InstantiateVnfContinueRunnable --> handleGrant error.", e); } + } + + private CBAMModifyVnfRequest generateModifyVnfRequest() throws IOException{ + String filePath = "/etc/vnfpkginfo/cbam_extension.json"; + String fileContent = CommonUtil.getJsonStrFromFile(filePath); + CBAMModifyVnfRequest req = gson.fromJson(fileContent, CBAMModifyVnfRequest.class); + return req; } private void handleVnfPackage() { @@ -110,17 +150,16 @@ public class InstantiateVnfContinueRunnable implements Runnable { process.waitFor(); if (HttpClientProcessorImpl.downLoadFromUrl(packageUrl, packageFileName, saveDir)) { - File csarFile = new File(saveDir + "/" + packageFileName); - //extract package - ZipUtil.explode(csarFile); - csarFile.delete(); - String cbamPackageDirName = saveDir + "/" + packageFileName + "/Artifacts"; - String cbamPackageName = new File(cbamPackageDirName).list()[0]; - cbamMgmr.uploadVnfPackage(cbamPackageName); - } + logger.info("handleVnfPackage download file " + packageUrl + " is successful."); +// File csarFile = new File(saveDir + "/" + packageFileName); +// //extract package +// ZipUtil.explode(csarFile); +// csarFile.delete(); + } } catch (Exception e) { - logger.error("Error to handleVnfPackage", e); + logger.error("Error to handleVnfPackage from SDC", e); } + } }); @@ -164,12 +203,21 @@ public class InstantiateVnfContinueRunnable implements Runnable { } private ResourceDefinition getFreeVnfResource() { - // TODO Auto-generated method stub - return null; + ResourceDefinition def = new ResourceDefinition(); + def.setVnfInstanceId(vnfInstanceId); + def.setVimId("001"); + List<AddResource> resources = new ArrayList<>(); + AddResource res = new AddResource(); + res.setVdu("1"); + res.setType("vdu"); + res.setResourceDefinitionId(2); + resources.add(res); + def.setAddResource(resources); + return def; } private void handleCbamInstantiateResponse(CBAMInstantiateVnfResponse cbamInstantiateResponse, String jobId) { - VnfmJobExecutionInfo jobInfo = jobDbMgmr.findOne(Long.getLong(jobId)); + VnfmJobExecutionInfo jobInfo = jobDbMgmr.findOne(Long.parseLong(jobId)); jobInfo.setVnfmExecutionId(cbamInstantiateResponse.getId()); if(CommonEnum.OperationStatus.FAILED == cbamInstantiateResponse.getStatus()){ @@ -178,16 +226,4 @@ public class InstantiateVnfContinueRunnable implements Runnable { jobDbMgmr.save(jobInfo); } - public static void main(String[] argv) { - String saveDir = "D:/tmp/20170926/data"; - String packageFileName = "vCSCF_v3.0.csar"; - File csarFile = new File(saveDir + "/" + packageFileName); - ZipUtil.explode(csarFile); - csarFile.delete(); - String cbamPackageDirName = saveDir + "/" + packageFileName + "/Artifacts"; - String cbamPackageName = new File(cbamPackageDirName).list()[0]; - System.out.println(cbamPackageName); - - } - } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java index 2995c140..00b82432 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/TerminateVnfContinueRunnable.java @@ -16,11 +16,9 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.adaptor; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.http.client.ClientProtocolException; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf; @@ -32,14 +30,13 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository.VnfmJobExecutionReposit import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmNotifyLCMEventsRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.AddResource; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.ResourceDefinition; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf; import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - public class TerminateVnfContinueRunnable implements Runnable { private static final Logger logger = LoggerFactory.getLogger(TerminateVnfContinueRunnable.class); @@ -49,11 +46,12 @@ public class TerminateVnfContinueRunnable implements Runnable { private TerminateVnfRequest driverRequest; private String vnfInstanceId; private String jobId; + private String vnfmId; private VnfmJobExecutionRepository jobDbMgmr; private Driver2CbamRequestConverter requestConverter; - public TerminateVnfContinueRunnable(TerminateVnfRequest driverRequest, String vnfInstanceId, String jobId, + public TerminateVnfContinueRunnable(String vnfmId, TerminateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository dbManager) { this.driverRequest = driverRequest; @@ -63,39 +61,63 @@ public class TerminateVnfContinueRunnable implements Runnable { this.requestConverter = requestConverter; this.jobId = jobId; this.jobDbMgmr = dbManager; + this.vnfmId = vnfmId; } - public void run() { + private void handleGrant(){ try { NslcmGrantVnfRequest grantRequest = buildNslcmGrantVnfRequest(); - NslcmGrantVnfResponse grantResponse = nslcmMgmr.grantVnf(grantRequest); - handleNslcmGrantResponse(grantResponse); - - CBAMTerminateVnfRequest cbamRequest = requestConverter.terminateReqConvert(driverRequest); - CBAMTerminateVnfResponse cbamResponse = cbamMgmr.terminateVnf(cbamRequest, vnfInstanceId); - handleCbamTerminateResponse(cbamResponse, jobId); - + nslcmMgmr.grantVnf(grantRequest); + } catch (Exception e) { + logger.error("TerminateVnfContinueRunnable --> handleGrant error.", e); + } + } + + public void run() { + handleGrant(); + handleTerminate(); + handleDelete(); + } + + private void handleDelete() { + try { cbamMgmr.deleteVnf(vnfInstanceId); - + } catch (Exception e) { + logger.error("TerminateVnfContinueRunnable --> handleDelete error.", e); + } + } + + private CBAMTerminateVnfResponse handleTerminate() { + CBAMTerminateVnfResponse cbamResponse = null; + try { + CBAMTerminateVnfRequest modifyReq = requestConverter.terminateReqConvert(driverRequest); + cbamResponse = cbamMgmr.terminateVnf(modifyReq, vnfInstanceId); + handleCbamTerminateResponse(cbamResponse, jobId); + } catch (Exception e) { + logger.error("TerminateVnfContinueRunnable --> handleTerminate error.", e); + } + + try { NslcmNotifyLCMEventsRequest nslcmNotifyReq = buildNslcmNotifyLCMEventsRequest(cbamResponse); - - nslcmMgmr.notifyVnf(nslcmNotifyReq, vnfInstanceId); - - } catch (ClientProtocolException e) { - logger.error("TerminateVnfContinueRunnable run error ClientProtocolException", e); - } catch (IOException e) { - logger.error("TerminateVnfContinueRunnable run error IOException", e); + nslcmMgmr.notifyVnf(nslcmNotifyReq, vnfmId, vnfInstanceId); + } catch (Exception e) { + logger.error("TerminateVnfContinueRunnable --> handleNotify error.", e); } + + return cbamResponse; } - + private void handleCbamTerminateResponse(CBAMTerminateVnfResponse cbamResponse, String jobId) { - VnfmJobExecutionInfo jobInfo = jobDbMgmr.findOne(Long.getLong(jobId)); + VnfmJobExecutionInfo jobInfo = jobDbMgmr.findOne(Long.parseLong(jobId)); jobInfo.setVnfmExecutionId(cbamResponse.getId()); - if(CommonEnum.OperationStatus.FAILED ==cbamResponse.getStatus()) { + if(CommonEnum.OperationStatus.FAILED == cbamResponse.getStatus()) { jobInfo.setStatus(CommonConstants.CBAM_OPERATION_STATUS_ERROR); } + else { + jobInfo.setStatus(cbamResponse.getStatus().toString()); + } jobDbMgmr.save(jobInfo); } @@ -103,7 +125,7 @@ public class TerminateVnfContinueRunnable implements Runnable { NslcmGrantVnfRequest request = new NslcmGrantVnfRequest(); request.setVnfInstanceId(vnfInstanceId); - request.setLifecycleOperation(LifecycleOperation.Instantiate); + request.setLifecycleOperation(LifecycleOperation.Terminal); request.setJobId(jobId); ResourceDefinition resource = getFreeVnfResource(); @@ -115,8 +137,17 @@ public class TerminateVnfContinueRunnable implements Runnable { } private ResourceDefinition getFreeVnfResource() { - // TODO Auto-generated method stub - return null; + ResourceDefinition def = new ResourceDefinition(); + def.setVnfInstanceId(vnfInstanceId); + def.setVimId("001"); + List<AddResource> resources = new ArrayList<>(); + AddResource res = new AddResource(); + res.setVdu("1"); + res.setType("vdu"); + res.setResourceDefinitionId(2); + resources.add(res); + def.setAddResource(resources); + return def; } private NslcmNotifyLCMEventsRequest buildNslcmNotifyLCMEventsRequest(CBAMTerminateVnfResponse cbamResponse) { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImpl.java index 236a17e6..a6bbb19b 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImpl.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImpl.java @@ -95,8 +95,15 @@ public class VnfmDriverMgmrImpl implements VnfmDriverMgmrInf{ public InstantiateVnfResponse instantiateVnf(InstantiateVnfRequest driverRequest, String vnfmId) throws VnfmDriverException { InstantiateVnfResponse driverResponse; try { + driverRequest.setVnfdId(adaptorEnv.getVnfdId()); buildVnfmHttpPathById(vnfmId); +// String dirPath = "/etc/vnfmpkg"; +// String cbamDirName = CommonUtil.getAppRoot() + dirPath; +// File cbamDirFile = new File(cbamDirName); +// String cbamPackageName = cbamDirFile.listFiles()[0].getAbsolutePath(); +// cbamMgmr.uploadVnfPackage(cbamPackageName); + //step 3: create vnf CBAMCreateVnfRequest cbamRequest = requestConverter.createReqConvert(driverRequest); CBAMCreateVnfResponse cbamResponse = cbamMgmr.createVnf(cbamRequest); @@ -105,7 +112,7 @@ public class VnfmDriverMgmrImpl implements VnfmDriverMgmrInf{ Long jobId = saveCreateVnfJob(vnfInstanceId); driverResponse = responseConverter.createRspConvert(cbamResponse, jobId); - vnfContinueProcessorInf.continueInstantiateVnf(driverRequest, vnfInstanceId, jobId.toString(), nslcmMgmr, catalogMgmr, cbamMgmr, requestConverter, jobDbManager); + vnfContinueProcessorInf.continueInstantiateVnf(vnfmId, driverRequest, vnfInstanceId, jobId.toString(), nslcmMgmr, catalogMgmr, cbamMgmr, requestConverter, jobDbManager); } catch (Exception e) { logger.error("error VnfmDriverMgmrImpl --> instantiateVnf. ", e); @@ -132,7 +139,7 @@ public class VnfmDriverMgmrImpl implements VnfmDriverMgmrInf{ buildVnfmHttpPathById(vnfmId); driverResponse = generateTerminateVnfResponse(vnfInstanceId); String jobId = driverResponse.getJobId(); - vnfContinueProcessorInf.continueTerminateVnf(driverRequest, vnfInstanceId, jobId, nslcmMgmr, cbamMgmr, requestConverter, jobDbManager); + vnfContinueProcessorInf.continueTerminateVnf(vnfmId, driverRequest, vnfInstanceId, jobId, nslcmMgmr, cbamMgmr, requestConverter, jobDbManager); } catch (Exception e) { logger.error("error VnfmDriverMgmrImpl --> terminateVnf. ", e); @@ -177,8 +184,9 @@ public class VnfmDriverMgmrImpl implements VnfmDriverMgmrInf{ try { buildVnfmHttpPathById(vnfmId); - VnfmJobExecutionInfo jobInfo = jobDbManager.findOne(Long.getLong(jobId)); + VnfmJobExecutionInfo jobInfo = jobDbManager.findOne(Long.parseLong(jobId)); String execId = jobInfo.getVnfmExecutionId(); + logger.info(" VnfmDriverMgmrImpl --> getOperStatus execId is " + execId); cbamResponse = cbamMgmr.queryOperExecution(execId); } catch (Exception e) { logger.error("error VnfmDriverMgmrImpl --> getOperStatus. ", e); @@ -222,7 +230,7 @@ public class VnfmDriverMgmrImpl implements VnfmDriverMgmrInf{ public String buildVnfmHttpPathById(String vnfmId) throws ClientProtocolException, IOException, VnfmDriverException { - return null; + return buildVnfmHttpPathByRealId(vnfmId); } public String buildVnfmHttpPathByRealId(String vnfmId) throws ClientProtocolException, IOException, VnfmDriverException { @@ -236,9 +244,9 @@ public class VnfmDriverMgmrImpl implements VnfmDriverMgmrInf{ EsrSystemInfo systemInfo = vnfmInfo.getEsrSystemInfoList().get(0); String urlHead = systemInfo.getServiceUrl(); - adaptorEnv.setCbamApiUriFront(urlHead); - adaptorEnv.setCbamUserName(systemInfo.getUserName()); - adaptorEnv.setCbamPassword(systemInfo.getPassword()); +// adaptorEnv.setCbamApiUriFront(urlHead); +// adaptorEnv.setCbamUserName(systemInfo.getUserName()); +// adaptorEnv.setCbamPassword(systemInfo.getPassword()); return urlHead; } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfRequest.java index d1c6a7bd..62e61c7d 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMCreateVnfRequest.java @@ -51,7 +51,5 @@ public class CBAMCreateVnfRequest { public void setDescription(String description) { this.description = description; } - - } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMInstantiateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMInstantiateVnfRequest.java index db79d190..a314627c 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMInstantiateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMInstantiateVnfRequest.java @@ -21,11 +21,16 @@ import java.util.List; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ExtManagedVirtualLinkData; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ExtVirtualLinkData; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VimComputeResourceFlavour; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VimInfo; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VimSoftwareImage; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.ZoneInfo; import com.fasterxml.jackson.annotation.JsonProperty; public class CBAMInstantiateVnfRequest { + @JsonProperty("instantiationLevelId") + private String instantiationLevelId; @JsonProperty("flavourId") private String flavourId; @@ -38,6 +43,21 @@ public class CBAMInstantiateVnfRequest { @JsonProperty("extManagedVirtualLinks") private List<ExtManagedVirtualLinkData> extManagedVirtualLinks; + + @JsonProperty("grantlessMode") + private boolean grantlessMode; + + @JsonProperty("softwareImages") + private List<VimSoftwareImage> softwareImages; + + @JsonProperty("additionalParams") + private Object additionalParams; + + @JsonProperty("computeResourceFlavours") + private List<VimComputeResourceFlavour> computeResourceFlavours; + + @JsonProperty("zones") + private List<ZoneInfo> zones; public String getFlavourId() { return flavourId; @@ -72,6 +92,58 @@ public class CBAMInstantiateVnfRequest { public void setExtManagedVirtualLinks(List<ExtManagedVirtualLinkData> extManagedVirtualLinks) { this.extManagedVirtualLinks = extManagedVirtualLinks; } + + public boolean isGrantlessMode() { + return grantlessMode; + } + + public void setGrantlessMode(boolean grantlessMode) { + this.grantlessMode = grantlessMode; + } + + public List<VimSoftwareImage> getSoftwareImages() { + return softwareImages; + } + + public void setSoftwareImages(List<VimSoftwareImage> softwareImages) { + this.softwareImages = softwareImages; + } + + public Object getAdditionalParams() { + return additionalParams; + } + + public void setAdditionalParams(Object additionalParams) { + this.additionalParams = additionalParams; + } + + public List<VimComputeResourceFlavour> getComputeResourceFlavours() { + return computeResourceFlavours; + } + + public void setComputeResourceFlavours(List<VimComputeResourceFlavour> computeResourceFlavours) { + this.computeResourceFlavours = computeResourceFlavours; + } + + public List<ZoneInfo> getZones() { + return zones; + } + + public void setZones(List<ZoneInfo> zones) { + this.zones = zones; + } + + public String getInstantiationLevelId() { + return instantiationLevelId; + } + + public void setInstantiationLevelId(String instantiationLevelId) { + this.instantiationLevelId = instantiationLevelId; + } + + + + diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMModifyVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMModifyVnfRequest.java new file mode 100644 index 00000000..15b3ab8e --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMModifyVnfRequest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2016-2017, Nokia Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; + +import java.util.ArrayList; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.VnfProperty; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class CBAMModifyVnfRequest { + @JsonProperty("name") + private String name; + + @JsonProperty("description") + private String description; + + @JsonProperty("metadata") + private String metadata; + + @JsonProperty("extensions") + private ArrayList<VnfProperty> extensions; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getMetadata() { + return metadata; + } + + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + public ArrayList<VnfProperty> getExtensions() { + return extensions; + } + + public void setExtensions(ArrayList<VnfProperty> extensions) { + this.extensions = extensions; + } + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMModifyVnfResponse.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMModifyVnfResponse.java new file mode 100644 index 00000000..62ce3484 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMModifyVnfResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2016-2017, Nokia Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity.OperationExecution; + +public class CBAMModifyVnfResponse extends OperationExecution{ + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMScaleVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMScaleVnfRequest.java index 399b3800..1b3cc099 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMScaleVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMScaleVnfRequest.java @@ -16,13 +16,13 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.ScaleDirection; import com.fasterxml.jackson.annotation.JsonProperty; public class CBAMScaleVnfRequest { @JsonProperty("type") - private CommonEnum.ScaleDirection type; + private ScaleDirection type; @JsonProperty("aspectId") private String aspectId; @@ -35,17 +35,18 @@ public class CBAMScaleVnfRequest { private Object additionalParams; - public CommonEnum.ScaleDirection getType() { + + + public ScaleDirection getType() { return type; } - public void setType(CommonEnum.ScaleDirection type) { + public void setType(ScaleDirection type) { this.type = type; } - public String getAspectId() { return aspectId; } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfRequest.java index acaa16fc..99fd8ac1 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/CBAMTerminateVnfRequest.java @@ -17,7 +17,7 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.TerminationType; import com.fasterxml.jackson.annotation.JsonProperty; @@ -30,13 +30,16 @@ public class CBAMTerminateVnfRequest { private String description; @JsonProperty("terminationType") - private CommonEnum.TerminationType terminationType; + private TerminationType terminationType; @JsonProperty("gracefulTerminationTimeout") private Integer gracefulTerminationTimeout; @JsonProperty("additionalParams") private Object additionalParams; + + + public String getName() { return name; @@ -54,13 +57,7 @@ public class CBAMTerminateVnfRequest { this.description = description; } - public CommonEnum.TerminationType getTerminationType() { - return terminationType; - } - - public void setTerminationType(CommonEnum.TerminationType terminationType) { - this.terminationType = terminationType; - } + public Integer getGracefulTerminationTimeout() { return gracefulTerminationTimeout; @@ -77,9 +74,15 @@ public class CBAMTerminateVnfRequest { public void setAdditionalParams(Object additionalParams) { this.additionalParams = additionalParams; } + + public TerminationType getTerminationType() { + return terminationType; + } - public enum TerminationType{ - GRACEFUL, FORCEFUL + public void setTerminationType(TerminationType terminationType) { + this.terminationType = terminationType; } + + } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ExtVirtualLinkData.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ExtVirtualLinkData.java index d981a77d..85bf5206 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ExtVirtualLinkData.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ExtVirtualLinkData.java @@ -22,14 +22,14 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; public class ExtVirtualLinkData { - @JsonProperty("flavourId") + @JsonProperty("resourceId") private String resourceId; - @JsonProperty("flavourId") + @JsonProperty("vimId") private String vimId; - @JsonProperty("flavourId") + @JsonProperty("extVirtualLinkId") private String extVirtualLinkId; - @JsonProperty("extVirtualLink") + @JsonProperty("extCps") private List<VnfExtCpData> extCps=new ArrayList<VnfExtCpData>(); public String getResourceId() { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/InterfaceInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/InterfaceInfo.java new file mode 100644 index 00000000..ea8b2148 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/InterfaceInfo.java @@ -0,0 +1,30 @@ +/* + * Copyright 2016-2017, Nokia Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; + +public class InterfaceInfo { + private String region; + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/Link.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/Link.java new file mode 100644 index 00000000..f209d1ab --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/Link.java @@ -0,0 +1,32 @@ +/* + * Copyright 2016-2017, Nokia Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Link { + @JsonProperty("href") + private String href; + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OpenStackAccessInfoV2.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OpenStackAccessInfoV2.java index d4d5b7c1..ffd7201f 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OpenStackAccessInfoV2.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OpenStackAccessInfoV2.java @@ -25,9 +25,6 @@ public class OpenStackAccessInfoV2 { @JsonProperty("password") private String password; - @JsonProperty("region") - private String region; - @JsonProperty("tenant") private String tenant; @@ -48,14 +45,6 @@ public class OpenStackAccessInfoV2 { this.password = password; } - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - public String getTenant() { return tenant; } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OperationExecution.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OperationExecution.java index e6dfbc87..89e3462e 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OperationExecution.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/OperationExecution.java @@ -49,9 +49,6 @@ public class OperationExecution { @JsonProperty("startTime") private String startTime; - @JsonProperty("finishTime") - private String finishTime; - @JsonProperty("grantId") private String grantId; @@ -156,13 +153,6 @@ public class OperationExecution { this.startTime = startTime; } - public String getFinishTime() { - return finishTime; - } - - public void setFinishTime(String finishTime) { - this.finishTime = finishTime; - } public String getGrantId() { return grantId; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimInfo.java index db55d95f..8dffeaa6 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VimInfo.java @@ -21,10 +21,16 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class VimInfo { @JsonProperty("id") private String id; - @JsonProperty("vimInfoType") - private VimInfoType vimInfoType; + @JsonProperty("interfaceInfo") + private InterfaceInfo interfaceInfo; + @JsonProperty("interfaceEndpoint") + private String interfaceEndpoint; + + @JsonProperty("accessInfo") + private OpenStackAccessInfoV2 accessInfo; + public String getId() { return id; } @@ -33,16 +39,28 @@ public class VimInfo { this.id = id; } - public VimInfoType getVimInfoType() { - return vimInfoType; + public InterfaceInfo getInterfaceInfo() { + return interfaceInfo; } - public void setVimInfoType(VimInfoType vimInfoType) { - this.vimInfoType = vimInfoType; + public void setInterfaceInfo(InterfaceInfo interfaceInfo) { + this.interfaceInfo = interfaceInfo; } - + public String getInterfaceEndpoint() { + return interfaceEndpoint; + } + public void setInterfaceEndpoint(String interfaceEndpoint) { + this.interfaceEndpoint = interfaceEndpoint; + } + + public OpenStackAccessInfoV2 getAccessInfo() { + return accessInfo; + } + + public void setAccessInfo(OpenStackAccessInfoV2 accessInfo) { + this.accessInfo = accessInfo; + } - -} +}
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfProperty.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfProperty.java index 55444de1..5e77de58 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfProperty.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/VnfProperty.java @@ -16,6 +16,28 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.entity; +import com.fasterxml.jackson.annotation.JsonProperty; + public class VnfProperty { + @JsonProperty("name") + private String name; + + @JsonProperty("value") + private Object value; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Object getValue() { + return value; + } + public void setValue(Object value) { + this.value = value; + } } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ZoneInfo.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ZoneInfo.java index fc283b80..ecbcba6e 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ZoneInfo.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/ZoneInfo.java @@ -20,8 +20,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class ZoneInfo { - @JsonProperty("vimId") - private String vimId; +/* @JsonProperty("vimId") + private String vimId;*/ @JsonProperty("resourceId") private String resourceId; @@ -29,13 +29,13 @@ public class ZoneInfo { @JsonProperty("id") private String id; - public String getVimId() { +/* public String getVimId() { return vimId; } public void setVimId(String vimId) { this.vimId = vimId; - } + }*/ public String getResourceId() { return resourceId; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/_links.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/_links.java index 3c8277ef..153b32d6 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/_links.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/bo/entity/_links.java @@ -20,59 +20,59 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class _links { @JsonProperty("cancel") - private String cancel; + private Link cancel; @JsonProperty("operationParams") - private String operationParams; + private Link operationParams; @JsonProperty("endNotification") - private String endNotification; + private Link endNotification; @JsonProperty("self") - private String self; + private Link self; @JsonProperty("additionalData") - private String additionalData; + private Link additionalData; @JsonProperty("list") - private String list; + private Link list; @JsonProperty("vnf") - private String vnf; - public String getCancel() { + private Link vnf; + public Link getCancel() { return cancel; } - public void setCancel(String cancel) { + public void setCancel(Link cancel) { this.cancel = cancel; } - public String getOperationParams() { + public Link getOperationParams() { return operationParams; } - public void setOperationParams(String operationParams) { + public void setOperationParams(Link operationParams) { this.operationParams = operationParams; } - public String getEndNotification() { + public Link getEndNotification() { return endNotification; } - public void setEndNotification(String endNotification) { + public void setEndNotification(Link endNotification) { this.endNotification = endNotification; } - public String getSelf() { + public Link getSelf() { return self; } - public void setSelf(String self) { + public void setSelf(Link self) { this.self = self; } - public String getAdditionalData() { + public Link getAdditionalData() { return additionalData; } - public void setAdditionalData(String additionalData) { + public void setAdditionalData(Link additionalData) { this.additionalData = additionalData; } - public String getList() { + public Link getList() { return list; } - public void setList(String list) { + public void setList(Link list) { this.list = list; } - public String getVnf() { + public Link getVnf() { return vnf; } - public void setVnf(String vnf) { + public void setVnf(Link vnf) { this.vnf = vnf; } @@ -80,5 +80,6 @@ public class _links { + } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/CbamMgmrImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/CbamMgmrImpl.java index 49a51f3a..0d862a82 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/CbamMgmrImpl.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/CbamMgmrImpl.java @@ -32,6 +32,8 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMModifyVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMModifyVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryOperExecutionResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfRequest; @@ -103,6 +105,26 @@ public class CbamMgmrImpl implements CbamMgmrInf { return response; } + public CBAMModifyVnfResponse modifyVnf(CBAMModifyVnfRequest cbamRequest, String vnfInstanceId) + throws ClientProtocolException, IOException { + String httpPath = String.format(CommonConstants.CbamModifyVnfPath, vnfInstanceId); + + RequestMethod method = RequestMethod.PATCH; + + HttpResult httpResult = operateCbamHttpTask(cbamRequest, httpPath, method); + String responseStr = httpResult.getContent(); + + logger.info("CbamMgmrImpl -> modifyVnf, responseStr is " + responseStr); + int code = httpResult.getStatusCode(); + if(code == 201) { + logger.info("CbamMgmrImpl -> modifyVnf success"); + }else { + logger.error("CbamMgmrImpl -> modifyVnf error "); + } + CBAMModifyVnfResponse response = gson.fromJson(responseStr, CBAMModifyVnfResponse.class); + return response; + } + /* (non-Javadoc) * @see com.nokia.vfcadaptor.cbam.impl.CbamMgmrInf#instantiateVnf(com.nokia.vfcadaptor.cbam.bo.CBAMInstantiateVnfRequest, java.lang.String) */ @@ -249,7 +271,6 @@ public class CbamMgmrImpl implements CbamMgmrInf { logger.error("CbamMgmrImpl -> CBAMQueryOperExecutionResponse, error" ); } - CBAMQueryOperExecutionResponse response = gson.fromJson(responseStr, CBAMQueryOperExecutionResponse.class); return response; @@ -286,28 +307,9 @@ public class CbamMgmrImpl implements CbamMgmrInf { logger.error("retrieveTokenError ", e); } String url = adaptorEnv.getCbamApiUriFront() + httpPath; - String command = "curl --insecure -X POST -H \"Authorization: bearer " + token + "\" --form content=@" + filePath + " " + url; - StringBuffer respStr = new StringBuffer(); - try { - logger.info("start to upload file."); - String os = System.getProperty("os.name"); - String[] cmd = {"cmd", "/C", command}; - if(!os.toLowerCase().startsWith("win")){ - cmd = new String[]{"/bin/sh"," -c ", command}; - } - Process process = Runtime.getRuntime().exec(cmd); - InputStream fis=process.getInputStream(); - InputStreamReader isr=new InputStreamReader(fis); - BufferedReader br=new BufferedReader(isr); - String line=null; - while((line = br.readLine())!=null) - { - respStr.append(line); - } - - } catch (Exception e) { - logger.error("operateCbamHttpUploadTask error", e); - } + logger.info("start to upload file."); + String command = "/usr/bin/curl --insecure -X POST -H \"Authorization: bearer " + token + "\" --form content=@" + filePath + " " + url; + StringBuffer respStr = execCommand(command); // HashMap<String, String> map = new HashMap<>(); // map.put(CommonConstants.AUTHORIZATION, "bearer " + token); @@ -320,6 +322,7 @@ public class CbamMgmrImpl implements CbamMgmrInf { // return httpClientProcessor.processBytes(url, method, map, fileBytes); HttpResult hResult = new HttpResult(); + hResult.setStatusCause(respStr.toString()); hResult.setContent(respStr.toString()); hResult.setStatusCode(200); return hResult; @@ -348,6 +351,40 @@ public class CbamMgmrImpl implements CbamMgmrInf { // // return result; } + + private StringBuffer execCommand(String command) { + logger.info("CbamMgmrImpl -> execCommand, command is " + command); + StringBuffer respStr = new StringBuffer("\r\n"); + try { + String os = System.getProperty("os.name"); + String[] cmd = {"cmd", "/c", command}; + if(!os.toLowerCase().startsWith("win")){ + cmd = new String[]{"/bin/sh","-c", command}; + } + Process process = Runtime.getRuntime().exec(cmd); + Thread t=new Thread(new InputStreamRunnable(process.getErrorStream(),"ErrorStream")); + t.start(); + Thread.sleep(3000); + InputStream fis=process.getInputStream(); + InputStreamReader isr=new InputStreamReader(fis); + + BufferedReader br=new BufferedReader(isr); + String line = null; + while((line = br.readLine())!=null) + { + respStr.append(line + "\r\n"); + } + respStr.append("\r\n"); + process.waitFor(); + fis.close(); + isr.close(); + process.destroy(); + logger.info("operateCbamHttpUploadTask respStr is: " + respStr); + } catch (Exception e) { + logger.error("operateCbamHttpUploadTask error", e); + } + return respStr; + } // public static String postByHttps(String url, String body, Object contentType) { // String result = ""; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/InputStreamRunnable.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/InputStreamRunnable.java new file mode 100644 index 00000000..5a1708fc --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/impl/InputStreamRunnable.java @@ -0,0 +1,57 @@ +/* + * Copyright 2016-2017, Nokia Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.impl; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; + +public class InputStreamRunnable implements Runnable +{ + BufferedReader bReader=null; + String type=null; + public InputStreamRunnable(InputStream is, String _type) + { + try + { + bReader=new BufferedReader(new InputStreamReader(new BufferedInputStream(is),"UTF-8")); + type=_type; + } + catch(Exception ex) + { + } + } + public void run() + { + String line; + int lineNum=0; + + try + { + while((line=bReader.readLine())!=null) + { + lineNum++; + //Thread.sleep(200); + } + bReader.close(); + } + catch(Exception ex) + { + } + } +}
\ No newline at end of file diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/inf/CbamMgmrInf.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/inf/CbamMgmrInf.java index d3bb970b..e4770bc1 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/inf/CbamMgmrInf.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/cbam/inf/CbamMgmrInf.java @@ -25,6 +25,8 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMHealVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMModifyVnfRequest; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMModifyVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryOperExecutionResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMQueryVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfRequest; @@ -35,7 +37,9 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfResponse; public interface CbamMgmrInf { public CBAMCreateVnfResponse createVnf(CBAMCreateVnfRequest cbamRequest) throws ClientProtocolException, IOException; - + + public CBAMModifyVnfResponse modifyVnf(CBAMModifyVnfRequest cbamRequest, String vnfInstanceId) throws ClientProtocolException, IOException; + public CBAMInstantiateVnfResponse instantiateVnf(CBAMInstantiateVnfRequest cbamRequest, String vnfInstanceId) throws ClientProtocolException, IOException; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/bo/AdaptorEnv.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/bo/AdaptorEnv.java index 1fed73f3..de8e9004 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/bo/AdaptorEnv.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/bo/AdaptorEnv.java @@ -89,6 +89,9 @@ public class AdaptorEnv { @Value("${numVirtualCpu}") private String numVirtualCpu; + + @Value("${vnfdId}") + private String vnfdId; public String getAaiServiceNameInMsb() { return aaiServiceNameInMsb; @@ -290,5 +293,13 @@ public class AdaptorEnv { this.numVirtualCpu = numVirtualCpu; } + public String getVnfdId() { + return vnfdId; + } + + public void setVnfdId(String vnfdId) { + this.vnfdId = vnfdId; + } + } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/util/CommonUtil.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/util/CommonUtil.java index e59a301a..add35c2f 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/util/CommonUtil.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/common/util/CommonUtil.java @@ -47,7 +47,7 @@ public final class CommonUtil { fileContent = new String(contentByte); } } catch(FileNotFoundException e) { - logger.error(fileName + "is not found!", e); + logger.error(fileName + " is not found!", e); } finally { if(ins != null) { ins.close(); diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonConstants.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonConstants.java index fd1864eb..0d11562b 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonConstants.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonConstants.java @@ -34,8 +34,8 @@ public class CommonConstants { public static final String RetrieveVnfmListPath = "/aai/v11/external-system/esr-vnfm-list/esr-vnfm/%s/esr-system-info-list"; //Nslcm path - public static final String NslcmGrantPath = "/api/vnflcm/v1//ns/grantvnf"; - public static final String NslcmNotifyPath = "/api/vnflcm/v1/vnfs/%s/Notify"; + public static final String NslcmGrantPath = "/api/nslcm/v1/ns/grantvnf"; + public static final String NslcmNotifyPath = "/api/nslcm/v1/ns/%s/vnfs/%s/Notify"; //Catalog path public static final String RetrieveVnfPackagePath = "/api/catalog/v1/vnfpackages/%s"; @@ -45,6 +45,7 @@ public class CommonConstants { public static final String CbamRetrieveTokenPath="/auth/realms/cbam/protocol/openid-connect/token"; public static final String CbamRetrieveTokenPostStr="grant_type=password&client_id=%s&client_secret=%s&username=%s&password=%s"; public static final String CbamCreateVnfPath="/vnfm/lcm/v3/vnfs"; + public static final String CbamModifyVnfPath="/vnfm/lcm/v3/vnfs/%s"; public static final String CbamInstantiateVnfPath="/vnfm/lcm/v3/vnfs/%s/instantiate"; public static final String CbamQueryVnfPath="/vnfm/lcm/v3/vnfs/%s"; public static final String CbamDeleteVnfPath="/vnfm/lcm/v3/vnfs/%s"; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonEnum.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonEnum.java index cbb94b94..06d20dec 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonEnum.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/CommonEnum.java @@ -38,10 +38,6 @@ public class CommonEnum { OUT, IN } - public enum ScaleType { - SCALE_OUT, SCALE_IN - } - public enum Deletionpending { TRUR, fALSE } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/ScaleDirection.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/ScaleDirection.java new file mode 100644 index 00000000..81f52af7 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/ScaleDirection.java @@ -0,0 +1,20 @@ +/* +* Copyright 2016-2017 Nokia Corporation +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.onap.vfc.nfvo.driver.vnfm.svnfm.constant; + +public enum ScaleDirection { + OUT, IN +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/ScaleType.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/ScaleType.java new file mode 100644 index 00000000..753bddc6 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/ScaleType.java @@ -0,0 +1,20 @@ +/* +* Copyright 2016-2017 Nokia Corporation +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.onap.vfc.nfvo.driver.vnfm.svnfm.constant; + +public enum ScaleType { + SCALE_OUT, SCALE_IN +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/TerminationType.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/TerminationType.java new file mode 100644 index 00000000..5e7fd911 --- /dev/null +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/constant/TerminationType.java @@ -0,0 +1,20 @@ +/* +* Copyright 2016-2017 Nokia Corporation +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package org.onap.vfc.nfvo.driver.vnfm.svnfm.constant; + +public enum TerminationType { + GRACEFUL, FORCEFUL +} diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientUtils.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientUtils.java index 13f1014f..0d3d5a1e 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientUtils.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpClientUtils.java @@ -27,6 +27,7 @@ import javax.net.ssl.X509TrustManager; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPatch; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.config.Registry; @@ -108,6 +109,9 @@ public class HttpClientUtils { case DELETE: base = new HttpDelete(); break; + case PATCH: + base = new HttpPatch(); + break; default: base = new HttpPost(); break; diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java index 2681be3f..c553238b 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/http/client/HttpRequestProcessor.java @@ -22,6 +22,7 @@ import java.net.URI; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.methods.HttpPatch; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.entity.ByteArrayEntity; @@ -80,7 +81,11 @@ public class HttpRequestProcessor { } public void addPostEntity(String bodyStr) { - ((HttpPost)httpRequest).setEntity(new StringEntity(bodyStr, CommonConstants.UTF_8)); + if(httpRequest instanceof HttpPost) { + ((HttpPost)httpRequest).setEntity(new StringEntity(bodyStr, CommonConstants.UTF_8)); + } else if(httpRequest instanceof HttpPatch) { + ((HttpPatch)httpRequest).setEntity(new StringEntity(bodyStr, CommonConstants.UTF_8)); + } } public void addBytesPostEntity(byte[] byteArray) { diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImpl.java index fc0ff31c..13ee87d0 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImpl.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImpl.java @@ -76,8 +76,8 @@ public class NslcmMgmrImpl implements NslcmMgmrInf{ return response; } - public void notifyVnf(NslcmNotifyLCMEventsRequest driverRequest, String vnfInstanceId) throws ClientProtocolException, IOException { - String httpPath = String.format(CommonConstants.NslcmNotifyPath, vnfInstanceId); + public void notifyVnf(NslcmNotifyLCMEventsRequest driverRequest, String vnfmId, String vnfInstanceId) throws ClientProtocolException, IOException { + String httpPath = String.format(CommonConstants.NslcmNotifyPath, vnfmId, vnfInstanceId); RequestMethod method = RequestMethod.POST; operateNslcmHttpTask(driverRequest, httpPath, method); diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/inf/NslcmMgmrInf.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/inf/NslcmMgmrInf.java index 537290c9..c1df7acb 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/inf/NslcmMgmrInf.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/inf/NslcmMgmrInf.java @@ -28,5 +28,5 @@ public interface NslcmMgmrInf { public NslcmGrantVnfResponse grantVnf(NslcmGrantVnfRequest driverRequest) throws ClientProtocolException, IOException; - public void notifyVnf(NslcmNotifyLCMEventsRequest driverRequest, String vnfInstanceId) throws ClientProtocolException, IOException; + public void notifyVnf(NslcmNotifyLCMEventsRequest driverRequest, String vnfmId, String vnfInstanceId) throws ClientProtocolException, IOException; } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/InstantiateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/InstantiateVnfRequest.java index 6f1325d3..e26e809b 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/InstantiateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/InstantiateVnfRequest.java @@ -32,9 +32,12 @@ public class InstantiateVnfRequest { @JsonProperty("vnfPackageId") private String vnfPackageId; + //this id is irrelevant to the CBAM vnfdid @JsonProperty("vnfDescriptorId") private String vnfDescriptorId; + private String vnfdId; + @JsonProperty("flavourId") private String flavourId; @@ -107,6 +110,14 @@ public class InstantiateVnfRequest { this.extVirtualLink = extVirtualLink; } + public String getVnfdId() { + return vnfdId; + } + + public void setVnfdId(String vnfdId) { + this.vnfdId = vnfdId; + } + } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/ScaleVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/ScaleVnfRequest.java index 536af321..13bf9bc3 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/ScaleVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/ScaleVnfRequest.java @@ -16,7 +16,8 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; + +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.ScaleType; import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.entity.AdditionalParam; import com.fasterxml.jackson.annotation.JsonProperty; @@ -26,7 +27,7 @@ public class ScaleVnfRequest { private String vnfInstanceId; @JsonProperty("type") - private CommonEnum.ScaleType type; + private ScaleType type; @JsonProperty("aspectId") private String aspectId; @@ -70,15 +71,19 @@ public class ScaleVnfRequest { this.vnfInstanceId = vnfInstanceId; } - public CommonEnum.ScaleType getType() { + public ScaleType getType() { return type; } - public void setType(CommonEnum.ScaleType type) { + public void setType(ScaleType type) { this.type = type; } + + + + diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/TerminateVnfRequest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/TerminateVnfRequest.java index 45acab42..c4795d32 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/TerminateVnfRequest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/bo/TerminateVnfRequest.java @@ -16,7 +16,7 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.TerminationType; import com.fasterxml.jackson.annotation.JsonProperty; @@ -26,31 +26,20 @@ public class TerminateVnfRequest { private String vnfInstanceId; @JsonProperty("terminationType") - private CommonEnum.TerminationType terminationType; + private TerminationType terminationType; @JsonProperty("gracefulTerminationTimeout") private Integer gracefulTerminationTimeout; - - public enum TerminationType{ - - GRACEFUL, FORCEFUL; - } - - - - - - public CommonEnum.TerminationType getTerminationType() { + public TerminationType getTerminationType() { return terminationType; } - public void setTerminationType(CommonEnum.TerminationType terminationType) { + public void setTerminationType(TerminationType terminationType) { this.terminationType = terminationType; } - public Integer getGracefulTerminationTimeout() { return gracefulTerminationTimeout; } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/impl/VnfContinueProcessorImpl.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/impl/VnfContinueProcessorImpl.java index e61323da..93c52b07 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/impl/VnfContinueProcessorImpl.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/impl/VnfContinueProcessorImpl.java @@ -34,16 +34,16 @@ import org.springframework.stereotype.Component; public class VnfContinueProcessorImpl implements VnfContinueProcessorInf{ @Override - public void continueInstantiateVnf(InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CatalogMgmrInf catalogMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository jobDbManager) { - InstantiateVnfContinueRunnable task = new InstantiateVnfContinueRunnable(driverRequest, vnfInstanceId, jobId, + public void continueInstantiateVnf(String vnfmId, InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CatalogMgmrInf catalogMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository jobDbManager) { + InstantiateVnfContinueRunnable task = new InstantiateVnfContinueRunnable(vnfmId, driverRequest, vnfInstanceId, jobId, nslcmMgmr, catalogMgmr, cbamMgmr, requestConverter, jobDbManager); Executors.newSingleThreadExecutor().submit(task); } @Override - public void continueTerminateVnf(TerminateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository jobDbManager) { - TerminateVnfContinueRunnable task = new TerminateVnfContinueRunnable(driverRequest, vnfInstanceId, jobId, + public void continueTerminateVnf(String vnfmId, TerminateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository jobDbManager) { + TerminateVnfContinueRunnable task = new TerminateVnfContinueRunnable(vnfmId, driverRequest, vnfInstanceId, jobId, nslcmMgmr, cbamMgmr, requestConverter, jobDbManager); Executors.newSingleThreadExecutor().submit(task); diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/inf/VnfContinueProcessorInf.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/inf/VnfContinueProcessorInf.java index 3898a477..6f9eb036 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/inf/VnfContinueProcessorInf.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/vnfmdriver/inf/VnfContinueProcessorInf.java @@ -25,6 +25,6 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest; import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest; public interface VnfContinueProcessorInf { - public void continueInstantiateVnf(InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CatalogMgmrInf catalogMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository jobDbManager); - public void continueTerminateVnf(TerminateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository jobDbManager); + public void continueInstantiateVnf(String vnfmId, InstantiateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CatalogMgmrInf catalogMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository jobDbManager); + public void continueTerminateVnf(String vnfmId, TerminateVnfRequest driverRequest, String vnfInstanceId, String jobId, NslcmMgmrInf nslcmMgmr, CbamMgmrInf cbamMgmr, Driver2CbamRequestConverter requestConverter, VnfmJobExecutionRepository jobDbManager); } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/application.properties b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/application.properties index 5b7f742d..5665ff0b 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/application.properties +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/main/resources/application.properties @@ -50,6 +50,7 @@ catalogVersionInMsb=v1 ## configure service name and version of MSB services AAI/LCM/Catalog end ## ## for retrieving token from CBAM begin ## +vnfdId=cscf_si1 grantType=password clientId=Orchestrator clientSecret=.1.qtcePQQ3.BqxiGBeyWUjREnGooRr6x1 diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImplTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImplTest.java index d5a0e100..d36a1d91 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImplTest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImplTest.java @@ -47,6 +47,7 @@ import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMScaleVnfResponse; import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf; import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo.AdaptorEnv; import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonEnum; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.ScaleType; import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.bean.VnfmJobExecutionInfo; import org.onap.vfc.nfvo.driver.vnfm.svnfm.db.repository.VnfmJobExecutionRepository; import org.onap.vfc.nfvo.driver.vnfm.svnfm.exception.VnfmDriverException; @@ -179,7 +180,7 @@ public class VnfmDriverMgmrImplTest { mockCbamResponse.setId("executionId_001"); when(cbamMgmr.scaleVnf(Mockito.any(CBAMScaleVnfRequest.class), Mockito.anyString())).thenReturn(mockCbamResponse); ScaleVnfRequest request = new ScaleVnfRequest(); - request.setType(CommonEnum.ScaleType.SCALE_IN); + request.setType(ScaleType.SCALE_IN); ScaleVnfResponse response = vnfmDriverMgmr.scaleVnf(request, vnfmId, vnfInstanceId); } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImplTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImplTest.java index c55b39d9..1e986707 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImplTest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nslcm/impl/NslcmMgmrImplTest.java @@ -65,6 +65,7 @@ public class NslcmMgmrImplTest { private HttpClientProcessorInf httpClientProcessor; private String vnfInstanceId = "vnfInstanceId_001"; + private String vnfmId = "vnfmId_001"; private Gson gson = new Gson(); @@ -180,6 +181,6 @@ public class NslcmMgmrImplTest { cbamRequest.setAffectedVirtualStorage(affectedVirtualStorage ); List<AffectedVnfc> affectedVnfc = new ArrayList<AffectedVnfc>(); cbamRequest.setAffectedVnfc(affectedVnfc ); - nslcmMgmr.notifyVnf(cbamRequest, vnfInstanceId); + nslcmMgmr.notifyVnf(cbamRequest, vnfmId, vnfInstanceId); } } |