diff --git a/ccsrc/Protocols/Json/json_codec_mec048.cc b/ccsrc/Protocols/Json/json_codec_mec048.cc index 9d8cdf668218378b46340bd981c3a68e9e140f4b..7afba5df40b7de7001f0e956a88c08f579f5ed54 100644 --- a/ccsrc/Protocols/Json/json_codec_mec048.cc +++ b/ccsrc/Protocols/Json/json_codec_mec048.cc @@ -18,15 +18,19 @@ int json_codec_mec048::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_tenantInfo)) { const SelfServiceEnablementAPI__TypesAndValues::TenantInfo& tenant_info = msg.tenantInfo(); tenant_info.encode(SelfServiceEnablementAPI__TypesAndValues::TenantInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = /*char2oct(CHARSTRING("{\"TenantInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + data = char2oct(CHARSTRING("{\"tenantInfo\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_resourceUsageSubscription)) { const SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription& resource_usage_subscription = msg.resourceUsageSubscription(); resource_usage_subscription.encode(SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = /*char2oct(CHARSTRING("{\"ResourceUsageSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + data = char2oct(CHARSTRING("{\"resourceUsageSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_siteResourceUsageSubscription)) { const SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription& site_resource_usage_subscription = msg.siteResourceUsageSubscription(); site_resource_usage_subscription.encode(SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); - data = /*char2oct(CHARSTRING("{\"SiteResourceUsageSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; + data = char2oct(CHARSTRING("{\"siteResourceUsageSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); + } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_resourceQuotaInfo)) { + const SelfServiceEnablementAPI__TypesAndValues::ResourceQuotaInfo& resource_quota_info = msg.resourceQuotaInfo(); + resource_quota_info.encode(SelfServiceEnablementAPI__TypesAndValues::ResourceQuotaInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); + data = char2oct(CHARSTRING("{\"resourceQuotaInfo\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); } else { return json_codec::encode(msg, data); } @@ -35,7 +39,7 @@ int json_codec_mec048::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms return 0; } -int json_codec_mec048::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) +int json_codec_mec048::decode(const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes::JsonBody& msg, params* p_params) { loggers::get_instance().log_msg(">>> json_codec_mec048::decode: p_data=", p_data); @@ -62,22 +66,44 @@ int json_codec_mec048::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo } else { str = it->second; } - // ..and create the decoding buffer - TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); - TTCN_EncDec::clear_error(); - loggers::get_instance().log("json_codec_mec048::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); - TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - if (it->second.find("\"tenantId\"") != std::string::npos) { // Be careful to the order - if (it->second[0] == '[') { - SelfServiceEnablementAPI__TypesAndValues::TenantInfoList tenant_info_list; - tenant_info_list.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.tenantInfoList() = tenant_info_list; + // Handle tenantInfo wrapper + std::string decoded_str; + if (str.find("\"tenantInfo\"") != std::string::npos) { + // Extract the inner JSON object + size_t start = str.find_first_of('{', str.find("\"tenantInfo\"") + 11); // Skip past "tenantInfo": + size_t end = str.rfind('}'); // Find the last closing brace + if (start != std::string::npos && end != std::string::npos && end > start) { + decoded_str = str.substr(start, end - start + 1); } else { - SelfServiceEnablementAPI__TypesAndValues::TenantInfo tenant_info; - tenant_info.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.tenantInfo() = tenant_info; + loggers::get_instance().warning("json_codec_mec048::decode: Invalid tenantInfo JSON structure: %s", str.c_str()); + return -1; } + } else if (str.find("\"resourceUsageSubscription\"") != std::string::npos) { + // Extract the inner JSON object for resourceUsageSubscription + size_t start = str.find_first_of('{', str.find("\"resourceUsageSubscription\"") + 25); // Skip past "resourceUsageSubscription": + size_t end = str.rfind('}'); // Find the last closing brace + if (start != std::string::npos && end != std::string::npos && end > start) { + decoded_str = str.substr(start, end - start + 1); + } else { + loggers::get_instance().warning("json_codec_mec048::decode: Invalid resourceUsageSubscription JSON structure: %s", str.c_str()); + return -1; + } + } else { + decoded_str = str; // Use original string if no tenantInfo wrapper + } + + // Create decoding buffer with the adjusted JSON + TTCN_Buffer decoding_buffer(OCTETSTRING(decoded_str.length(), (const unsigned char*)decoded_str.c_str())); + + if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"ResourceUsageSubscription\"") != std::string::npos)) { + SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription resource_usage_subscription; + resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.resourceUsageSubscription() = resource_usage_subscription; + } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SiteResourceUsageSubscription\"") != std::string::npos)) { + SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription site_resource_usage_subscription; + site_resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.siteResourceUsageSubscription() = site_resource_usage_subscription; } else if ( (it->second.find("\"_links\"") != std::string::npos) && ((it->second.find("\"subscriptions\"") != std::string::npos) || (it->second.find("\"subscriptionType\"") == std::string::npos)) @@ -85,16 +111,21 @@ int json_codec_mec048::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo SelfServiceEnablementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; subscription_link_list.decode(SelfServiceEnablementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.subscriptionLinkList__cse() = subscription_link_list; - } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"ResourceUsageSubscription\"") != std::string::npos)) { - SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription resource_usage_subscription; - resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::ResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.resourceUsageSubscription() = resource_usage_subscription; - } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SiteResourceUsageSubscription\"") != std::string::npos)) { - SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription site_resource_usage_subscription; - site_resource_usage_subscription.decode(SelfServiceEnablementAPI__TypesAndValues::SiteResourceUsageSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.siteResourceUsageSubscription() = site_resource_usage_subscription; + } else if (it->second.find("\"tenantId\"") != std::string::npos) { // Be careful to the order + if (it->second[0] == '[') { + SelfServiceEnablementAPI__TypesAndValues::TenantInfoList tenant_info_list; + tenant_info_list.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.tenantInfoList() = tenant_info_list; + } else{ + SelfServiceEnablementAPI__TypesAndValues::TenantInfo tenant_info; + tenant_info.decode(SelfServiceEnablementAPI__TypesAndValues::TenantInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.tenantInfo() = tenant_info; + } } else { - return json_codec::decode(p_data, msg, p_params); + loggers::get_instance().warning("json_codec_mec048::decode: No matching structure found, assigning raw"); + // Assign raw alternative of union with full original string + msg.raw() = CHARSTRING(str.c_str()); + loggers::get_instance().log("json_codec_mec048::decode: Assigned raw='%s'", str.c_str()); } loggers::get_instance().log_msg("<<< json_codec_mec048::decode: ", (const Base_Type&)msg); diff --git a/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn index 2a74b771668fd7a344ea2fcf2324ccb07321e175..67b7a0f5632f4e14742fdc6c09a6539d74e432bf 100644 --- a/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec_SelfServiceEnablement/AtsMec_SelfServiceEnablementAPI_TestCases.ttcn @@ -36,7 +36,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, "Retail", omit, PX_CSE_TENANT_NAME_1)), valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_2, PX_CSE_CUSTOMER_NAME_2, "Education", omit, PX_CSE_TENANT_NAME_2)), valueof(m_tenant_info(PX_CSE_CUSTOMER_ID_3, PX_CSE_CUSTOMER_NAME_3, "Automotive", omit, PX_CSE_TENANT_NAME_3)) - }; + }; // Test control if (not(PICS_SERVICES) or not(PICS_CSE_API_SUPPORTED)) { @@ -67,24 +67,30 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( + mw_http_response_ok( mw_http_message_body_json( mw_body_json_cse_tenant_info_list( { mw_tenant_info( PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, + *, + ?, PX_CSE_TENANT_NAME_1 ), mw_tenant_info( PX_CSE_CUSTOMER_ID_2, - PX_CSE_CUSTOMER_NAME_1, + PX_CSE_CUSTOMER_NAME_2, + *, + ?, PX_CSE_TENANT_NAME_2 ), mw_tenant_info( PX_CSE_CUSTOMER_ID_3, - PX_CSE_CUSTOMER_NAME_2, - PX_CSE_TENANT_NAME_1 + PX_CSE_CUSTOMER_NAME_3, + *, + ?, + PX_CSE_TENANT_NAME_3 ) } ))))) { @@ -153,8 +159,17 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_tenant_info( PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, + *, + ?, PX_CSE_TENANT_NAME_1 - ) + ), + mw_tenant_info( + PX_CSE_CUSTOMER_ID_3, + PX_CSE_CUSTOMER_NAME_3, + *, + ?, + PX_CSE_TENANT_NAME_3 + ) } ))))) { tc_ac.stop; @@ -221,14 +236,18 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { { mw_tenant_info( PX_CSE_CUSTOMER_ID_1, - PX_CSE_CUSTOMER_NAME_1, - PX_CSE_TENANT_NAME_1, PX_CSE_TENANT_NAME_1 + PX_CSE_CUSTOMER_NAME_1, + *, + ?, + PX_CSE_TENANT_NAME_1 ), mw_tenant_info( PX_CSE_CUSTOMER_ID_2, PX_CSE_CUSTOMER_NAME_2, + *, + ?, PX_CSE_TENANT_NAME_2 - ) + ) } ))))) { tc_ac.stop; @@ -274,17 +293,17 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO, + v_headers, + m_http_message_body_json( m_body_json_cse_tenant_info( m_tenant_info( PX_CSE_CUSTOMER_ID_2, - PX_CSE_CUSTOMER_NAME_1, + PX_CSE_CUSTOMER_NAME_2, omit, omit, - PX_CSE_TENANT_NAME_1 + PX_CSE_TENANT_NAME_2 )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -298,9 +317,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_body_json_cse_tenant_info( mw_tenant_info( PX_CSE_CUSTOMER_ID_2, - PX_CSE_CUSTOMER_NAME_1, - PX_CSE_TENANT_NAME_1 + PX_CSE_CUSTOMER_NAME_2, + *, + ?, + PX_CSE_TENANT_NAME_2 )))))) -> value v_response { + tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a TenantInfo ***"); @@ -342,10 +364,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO, + v_headers, + m_http_message_body_json( m_body_json_cse_tenant_info( m_tenant_info( PX_CSE_CUSTOMER_ID_1, @@ -354,7 +376,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { omit, PX_CSE_TENANT_NAME_1, m_resource_info(100, 50, 50, 1024, 512, 512, 2048, 1024, 1024), - m_site_info("site-001", omit) + { m_site_info(PX_CSE_SITE_ID_1, omit), + m_site_info(PX_CSE_SITE_ID_2, m_resource_info(100, 50, 50, 1024, omit, 512, 2048, 1024, omit)) } )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -424,7 +447,9 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_tenant_info( PX_CSE_CUSTOMER_ID_1, PX_CSE_CUSTOMER_NAME_1, - PX_CSE_TENANT_NAME_1 + *, + ?, + PX_CSE_TENANT_NAME_1 ) ))))) { @@ -470,7 +495,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_get( + m_http_request_get( PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_CSE_TENANT_ID, "UTF-8")), v_headers ))); @@ -481,7 +506,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_404_not_found + mw_http_response_404_not_found )) { tc_ac.stop; @@ -527,15 +552,15 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id, - v_headers, - m_http_message_body_json( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id, + v_headers, + m_http_message_body_json( m_body_json_cse_tenant_info( m_tenant_info( PX_NEW_CUSTOMER_ID, PX_NEW_CUSTOMER_NAME, omit, - omit, + v_tenant_id, PX_NEW_TENANT_NAME ) ))))); @@ -552,6 +577,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_tenant_info( PX_NEW_CUSTOMER_ID, PX_NEW_CUSTOMER_NAME, + *, + ?, PX_NEW_TENANT_NAME )))))) { tc_ac.stop; @@ -598,7 +625,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), v_headers, m_http_message_body_json( - m_body_json_cse_tenant_info( + m_body_json_cse_tenant_info( m_tenant_info( PX_NEW_CUSTOMER_ID, PX_NEW_CUSTOMER_NAME, @@ -657,20 +684,20 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( - m_http_request_put( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), - v_headers, - m_http_message_body_json( - m_body_json_cse_tenant_info( - m_tenant_info( - PX_NEW_CUSTOMER_ID, - PX_NEW_CUSTOMER_NAME, - omit, - omit, - PX_NEW_TENANT_NAME, - m_resource_info(100, 50, 50, 1024, 512, 512, 2048, 1024, 1024), - m_site_info("site-001", omit) - ) + m_http_request_put( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_cse_tenant_info( + m_tenant_info( + PX_NEW_CUSTOMER_ID, + PX_NEW_CUSTOMER_NAME, + omit, + omit, + PX_NEW_TENANT_NAME, + m_resource_info(100, 50, 50, 1024, 512, 512, 2048, 1024, 1024), + { m_site_info(PX_CSE_SITE_ID_1, omit) } + ) ))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -848,9 +875,9 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { alt { [] httpPort.receive( mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_cse_resource_quota_info( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_cse_resource_quota_info( mw_resource_quota_info( PX_CPU_QUOTA_1, PX_MEMORY_QUOTA_1, @@ -1087,17 +1114,17 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort.send( - m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", - v_headers, - m_http_message_body_json( - mw_body_json_cse_resource_quota_info( - m_resource_quota_info( - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))); + m_http_request( + m_http_request_post( + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", + v_headers, + m_http_message_body_json( + mw_body_json_cse_resource_quota_info( + m_resource_quota_info( + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -1157,7 +1184,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system", v_headers, m_http_message_body_json( m_body_json_cse_resource_quota_info( @@ -1223,7 +1250,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & v_tenant_id & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1237,17 +1264,17 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_body_json_cse_site_resource_quota_info_list( { mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ), + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ), mw_site_resource_quota_info( - PX_SITE_ID_2, - PX_CPU_QUOTA_2, - PX_MEMORY_QUOTA_2, - PX_DISK_QUOTA_2 - ), + PX_SITE_ID_2, + PX_CPU_QUOTA_2, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + ), mw_site_resource_quota_info( PX_SITE_ID_3, PX_CPU_QUOTA_3, @@ -1305,11 +1332,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/resources/quota_in_sites?siteId=" & v_site_id_list[0] & "/" & v_site_id_list[1], + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system?siteId=" & v_site_id_list[0] & "/" & v_site_id_list[1], v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1320,20 +1346,20 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_cse_site_resource_quota_info_list( - { - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ), - mw_site_resource_quota_info( - PX_SITE_ID_2, - PX_CPU_QUOTA_2, - PX_MEMORY_QUOTA_2, - PX_DISK_QUOTA_2 - ) - } + { + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ), + mw_site_resource_quota_info( + PX_SITE_ID_2, + PX_CPU_QUOTA_2, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + ) + } ))))) { tc_ac.stop; @@ -1373,11 +1399,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // Preamble f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1428,23 +1453,22 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // Test adapter configuration // Preamble - f_create_tenant_info(v_tenant_info, v_tenant_id); //TODO: change function name + f_create_tenant_info(v_tenant_info, v_tenant_id); f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", v_headers, m_http_message_body_json( m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))); + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -1452,12 +1476,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_201_created( mw_http_message_body_json( mw_body_json_cse_site_resource_quota_info( - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))) -> value v_response { + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { @@ -1467,7 +1491,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { var charstring_list v_location_header; f_get_header(v_response.response.header, "Location", v_location_header); // Build expected regex pattern with specific tenant ID - var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_sites/[^/]+"; + var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_system/[^/]+"; if (regexp(v_location_header[0], v_expected_pattern, 0) != "") { log("Location header matches expected pattern with tenant ID: " & v_tenant_id); } else { @@ -1516,30 +1540,34 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_create_tenant_info(v_tenant_info, v_tenant_id); f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases + httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system", v_headers, m_http_message_body_json( - m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - - + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + - )))))); tc_ac.start; alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_400_bad_request - )) { - tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request + )) { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } } // End of 'alt' statement // Postamble @@ -1580,7 +1608,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_sites" & "/" & v_site_id, + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system" & "/" & v_site_id, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1592,12 +1620,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_cse_site_resource_quota_info( - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ) + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) ))))) { tc_ac.stop; @@ -1637,11 +1665,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { // Preamble f_init_default_headers_list(-, -, v_headers); - //TODO: check uri and uri names of all testcases httpPort.send( m_http_request( m_http_request_get( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_sites" & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SITE_ID, "UTF-8")), + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_TENANT_ID, "UTF-8")) & "/resources/quota_in_system" & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SITE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -1700,16 +1727,16 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { httpPort.send( m_http_request( m_http_request_put( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & v_tenant_id & "/resources/quota_in_system/" & v_site_id, + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & v_tenant_id & "/resources/quota_in_system/" & v_site_id, v_headers, m_http_message_body_json( - m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))); + m_body_json_cse_site_resource_quota_info( + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -1717,12 +1744,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_cse_site_resource_quota_info( - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_2, - PX_DISK_QUOTA_2 - )))))) -> value v_response { + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_2, + PX_DISK_QUOTA_2 + )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header @@ -1733,7 +1760,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { var charstring_list v_location_header; f_get_header(v_response.response.header, "Location", v_location_header); // Build expected regex pattern with specific tenant ID - var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_sites/[^/]+"; + var charstring v_expected_pattern := "/cse/v1/tenants/" & v_tenant_id & "/resources/quota_in_system/[^/]+"; if (regexp(v_location_header[0], v_expected_pattern, 0) != "") { log("Location header matches expected pattern with tenant ID: " & v_tenant_id); } else { @@ -1794,11 +1821,11 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { v_headers, m_http_message_body_json( m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( //one of cpuQuota, memoryQuota and, diskQuota shall be present. - PX_SITE_ID_1, - -, - -, - - + m_site_resource_quota_info( + PX_SITE_ID_1, + -, + -, + - )))))); tc_ac.start; alt { @@ -1810,6 +1837,11 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } + + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } } // End of 'alt' statement // Postamble @@ -1855,12 +1887,12 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { v_headers, m_http_message_body_json( m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - )))))); + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -1876,7 +1908,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement + + // Postamble f_cf_01_http_down(); + } // End of testcase TC_MEC_MEC048_MEO_CSE_012_NF } // End of group tenant @@ -2109,7 +2144,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { *, *, PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, + ?, m_notification_trigger ( e_tt_ten, 4, @@ -2183,8 +2218,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { -, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, m_notification_trigger ( e_tt_ten, 4, @@ -2207,8 +2242,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { -, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, m_notification_trigger ( e_tt_ten, 4, @@ -2275,10 +2310,10 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { m_http_message_body_json( m_body_json_resource_usage_subscription( m_resource_usage_subscription( - omit, + PX_CSE_SUB_CALLBACK_URI, true, omit, - -, + omit, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, m_notification_trigger ( @@ -2358,20 +2393,20 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_site_resource_usage_subscription( - mw_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - *, omit, - -, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger ( - e_tt_ten, - 4, - false - ) + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + *, omit, + -, + PX_CSE_CUSTOMER_ID_1, + ?, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) )))))) { tc_ac.stop; @@ -2488,8 +2523,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { v_links, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, m_notification_trigger ( e_tt_ten, 4, @@ -2506,21 +2541,21 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_site_resource_usage_subscription( - mw_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - omit, - -, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger ( - e_tt_ten, - 4, - false - ) - )))))) -> value v_response { + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + ?, + PX_CSE_CUSTOMER_ID_1, + ?, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) + )))))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully updates the siteResourceUsageSubscription ***"); @@ -2573,8 +2608,8 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { -, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, m_notification_trigger ( e_tt_ten, 4, @@ -2638,7 +2673,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { m_http_message_body_json( m_body_json_resource_usage_subscription( m_resource_usage_subscription( - omit, + PX_CSE_SUB_CALLBACK_URI, true, omit, -, @@ -2825,15 +2860,15 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { -, mw_http_message_body_json( mw_body_json_site_resource_usage_notification( - mw_site_resource_usage_notification( - { seconds := 1684748494, nanoSeconds := 123456789 }, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - mw_site_resource_use_info( - PX_SITE_ID_1, - 5 - ) - )))))) { + mw_site_resource_usage_notification( + { seconds := 1684748494, nanoSeconds := 123456789 }, + PX_CSE_CUSTOMER_ID_1, + ?, + mw_site_resource_use_info( + PX_SITE_ID_1, + 5 + ) + )))))) { tc_ac.stop; f_init_default_headers_list(-, -, v_headers); @@ -2895,7 +2930,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_resource_usage_notification( *, PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, + ?, mw_resource_use_info ( 5 ) @@ -2960,7 +2995,7 @@ module AtsMec_SelfServiceEnablementAPI_TestCases { mw_http_message_body_json( mw_body_json_cse_expiry_notification( mw_cse_expiry_notification( - -, + ?, { seconds := 1684748494, nanoSeconds := 123456789 } ) ))))) { diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn index d65a164307e1ba110954a9e2f7f3d7e3f614a355..659a0d5ffa0335478cc0f866958efbb3b28ff226 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Functions.ttcn @@ -11,6 +11,7 @@ module SelfServiceEnablementAPI_Functions { // LibHttp import from LibHttp_TypesAndValues all; + import from LibHttp_JsonMessageBodyTypes all; import from LibHttp_Functions all; import from LibHttp_Templates all; import from LibHttp_JsonTemplates all; @@ -22,6 +23,7 @@ module SelfServiceEnablementAPI_Functions { import from SelfServiceEnablementAPI_Pixits all; // LibMec + import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Pics all; @@ -33,9 +35,12 @@ module SelfServiceEnablementAPI_Functions { ) runs on HttpComponent { log(">>> f_create_tenant_info_list: ", p_tenant_info_list); var charstring v_tenant_id; + p_tenant_id_list := {}; for (var integer i := 0; i < lengthof(p_tenant_info_list); i := i + 1) { f_create_tenant_info(p_tenant_info_list[i], v_tenant_id); - p_tenant_id_list := p_tenant_id_list & { v_tenant_id }; + if (lengthof(v_tenant_id) > 0) { + p_tenant_id_list := p_tenant_id_list & { v_tenant_id }; + } } } // End of function f_create_tenant_info_list @@ -55,8 +60,14 @@ module SelfServiceEnablementAPI_Functions { PICS_ROOT_API & PX_CSE_TENANTS_INFO, v_headers, m_http_message_body_json( - m_body_json_cse_tenant_info(p_tenant_info) - )))); + m_body_json_cse_tenant_info( + m_tenant_info( + p_tenant_info.customerId, + p_tenant_info.customerName, + p_tenant_info.customerCategory, + omit, + p_tenant_info.tenantName + )))))); tc_ac.start; alt { [] httpPort.receive( @@ -65,11 +76,11 @@ module SelfServiceEnablementAPI_Functions { mw_http_message_body_json( mw_body_json_cse_tenant_info( mw_tenant_info( + p_tenant_info.customerId, + p_tenant_info.customerName, + p_tenant_info.customerCategory, ?, - ?, - ?, - ?, - ? + p_tenant_info.tenantName ) ))))) -> value v_response { tc_ac.stop; @@ -78,14 +89,16 @@ module SelfServiceEnablementAPI_Functions { var charstring_list v_tenant_id; f_get_header(v_response.response.header, "Location", v_tenant_id); // Extract HTTP tenant id - p_tenant_id := regexp( - v_tenant_id[0], - "?+" & PX_CSE_TENANTS_INFO & "/(?*)", - 0 - ); - - p_tenant_info := v_response.response.body.json_body.tenantInfo; - log("f_create_tenant_info: INFO: IUT successfully creates the Tenants: ", p_tenant_info); + if (ispresent(v_tenant_id) and lengthof(v_tenant_id) > 0) { + p_tenant_id := regexp( + v_tenant_id[0], + "?+" & PX_CSE_TENANTS_INFO & "/(?*)", + 0 + ); + + p_tenant_info := v_response.response.body.json_body.tenantInfo; + log("f_create_tenant_info: INFO: IUT successfully creates the Tenants: ", p_tenant_info); + } } [] tc_ac.timeout { log("f_create_tenant_info: INCONC: Expected message not received"); @@ -194,11 +207,12 @@ module SelfServiceEnablementAPI_Functions { ) runs on HttpComponent { log(">>> f_create_site_resource_quota_info_list: ", p_site_resource_quota_info); var charstring v_site_resource_quota_info_id; + p_site_resource_quota_info_id_list := {}; for (var integer i := 0; i < lengthof(p_site_resource_quota_info); i := i + 1) { f_create_site_resource_quota_info(p_site_resource_quota_info[i], -, p_tenant_id); p_site_resource_quota_info_id_list := p_site_resource_quota_info_id_list & { v_site_resource_quota_info_id }; } - } // End of function f_create_tenant_info_list + } // End of function f_create_site_resource_quota_info_list function f_create_site_resource_quota_info( inout SiteResourceQuotaInfo p_site_resource_quota_info, @@ -214,30 +228,30 @@ module SelfServiceEnablementAPI_Functions { httpPort.send( m_http_request( m_http_request_post( - PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & p_tenant_id & "/resources/quota_in_sites", + PICS_ROOT_API & PX_CSE_TENANTS_INFO & "/" & p_tenant_id & "/resources/quota_in_system", v_headers, m_http_message_body_json( m_body_json_cse_site_resource_quota_info( - m_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ) + m_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) ))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_cse_site_resource_quota_info( - mw_site_resource_quota_info( - PX_SITE_ID_1, - PX_CPU_QUOTA_1, - PX_MEMORY_QUOTA_1, - PX_DISK_QUOTA_1 - ) + mw_http_message_body_json( + mw_body_json_cse_site_resource_quota_info( + mw_site_resource_quota_info( + PX_SITE_ID_1, + PX_CPU_QUOTA_1, + PX_MEMORY_QUOTA_1, + PX_DISK_QUOTA_1 + ) ))))) -> value v_response { tc_ac.stop; p_site_resource_quota_info := v_response.response.body.json_body.siteResourceQuotaInfo; @@ -271,14 +285,16 @@ module SelfServiceEnablementAPI_Functions { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_LIST_SUBS, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( m_body_json_resource_usage_subscription( m_resource_usage_subscription( PX_CSE_SUB_CALLBACK_URI, - omit, omit, omit, + true, + omit, + omit, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, m_notification_trigger( @@ -292,15 +308,17 @@ module SelfServiceEnablementAPI_Functions { alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_resource_usage_subscription( - mw_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - *, - *, - ?,?,? + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_resource_usage_subscription( + mw_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + ?, + ? ) ))))) -> value v_response { tc_ac.stop; @@ -325,50 +343,51 @@ module SelfServiceEnablementAPI_Functions { } // End of function f_create_resource_usage_subscription function f_create_site_resource_usage_subscription( - out SiteResourceUsageSubscription p_site_resource_usage_subscription, - out charstring p_subscription_id, - out Links p_links - ) runs on HttpComponent { + out SiteResourceUsageSubscription p_site_resource_usage_subscription, + out charstring p_subscription_id, + out Links p_links + ) runs on HttpComponent { var Headers v_headers; var HttpMessage v_response; f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_LIST_SUBS, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( m_body_json_site_resource_usage_subscription( - m_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - omit, omit, omit, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger( - e_tt_ten, - 5, - true - ) - ) - ))))); + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, + m_notification_trigger( + e_tt_ten, + 5, + true + ) + )))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_site_resource_usage_subscription( - mw_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - *, - *, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID - ) + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + ? + ) ))))) -> value v_response { tc_ac.stop; @@ -403,14 +422,16 @@ module SelfServiceEnablementAPI_Functions { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - PICS_ROOT_API & PX_CSE_LIST_SUBS, - v_headers, - m_http_message_body_json( + m_http_request_post( + PICS_ROOT_API & PX_CSE_LIST_SUBS, + v_headers, + m_http_message_body_json( m_body_json_resource_usage_subscription( m_resource_usage_subscription( PX_CSE_SUB_CALLBACK_URI, - omit, omit, omit, + true, + omit, + omit, PX_CSE_CUSTOMER_ID_1, PX_CSE_TENANT_ID, m_notification_trigger ( @@ -418,23 +439,22 @@ module SelfServiceEnablementAPI_Functions { 4, false ) - ) - ))))); + )))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_resource_usage_subscription( - mw_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - *, - -, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID - ) + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_resource_usage_subscription( + mw_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + ? + ) ))))) -> value v_response { tc_ac.stop; @@ -472,43 +492,43 @@ module SelfServiceEnablementAPI_Functions { PICS_ROOT_API & PX_CSE_LIST_SUBS, v_headers, m_http_message_body_json( - m_body_json_site_resource_usage_subscription( - m_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, omit, - omit, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger ( - e_tt_ten, - 4, - false - ) + m_body_json_site_resource_usage_subscription( + m_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, omit, + omit, + PX_CSE_CUSTOMER_ID_1, + PX_CSE_TENANT_ID, + { m_site_id(PX_CSE_SITE_ID_1), + m_site_id(PX_CSE_SITE_ID_2) }, + m_notification_trigger ( + e_tt_ten, + 4, + false + ) )))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( - mw_http_message_body_json( - mw_body_json_site_resource_usage_subscription( - mw_site_resource_usage_subscription( - PX_CSE_SUB_CALLBACK_URI, - true, - omit, - -, - PX_CSE_CUSTOMER_ID_1, - PX_CSE_TENANT_ID, - { m_site_id("site-001"), - m_site_id("site-002") }, - m_notification_trigger ( - e_tt_ten, - 4, - false - ) - ) + mw_http_response_201_created( + mw_http_message_body_json( + mw_body_json_site_resource_usage_subscription( + mw_site_resource_usage_subscription( + PX_CSE_SUB_CALLBACK_URI, + true, + omit, + -, + PX_CSE_CUSTOMER_ID_1, + ?, + { mw_site_id(PX_CSE_SITE_ID_1), + mw_site_id(PX_CSE_SITE_ID_2) }, + mw_notification_trigger ( + e_tt_ten, + 4, + false + ) + ) ))))) -> value v_response { tc_ac.stop; @@ -522,11 +542,11 @@ module SelfServiceEnablementAPI_Functions { 0 ); p_site_resource_usage_subscription := v_response.response.body.json_body.siteResourceUsageSubscription; - log("f_create_site_resource_usage_subscription: INFO: IUT successfully responds to the subscription: ", p_site_resource_usage_subscription); - log("f_create_site_resource_usage_subscription: INFO: p_subscription_id: ", p_subscription_id); + log("f_create_site_resource_usage_subscription_2: INFO: IUT successfully responds to the subscription: ", p_site_resource_usage_subscription); + log("f_create_site_resource_usage_subscription_2: INFO: p_subscription_id: ", p_subscription_id); } [] tc_ac.timeout { - log("f_create_resource_usage_subscription: Expected message not received"); + log("f_create_site_resource_usage_subscription_2: Expected message not received"); } } // End of 'alt' statement } // End of function f_create_site_resource_usage_subscription diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn index 6ed7a28e69846cc76080e7ba38ae4f77ff38c422..e585010d7f2bdb46e3f205311680cd9b9014f655 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Pixits.ttcn @@ -9,63 +9,67 @@ module SelfServiceEnablementAPI_Pixits { // LibMec/SelfServiceEnablementAPI import from SelfServiceEnablementAPI_TypesAndValues all; - modulepar Json.String PX_CSE_CUSTOMER_ID_1 := "" + modulepar Json.String PX_CSE_CUSTOMER_ID_1 := "customer01" - modulepar Json.String PX_CSE_CUSTOMER_NAME_1 := "customerName"; + modulepar Json.String PX_CSE_CUSTOMER_NAME_1 := "customerName"; - modulepar Json.String PX_CSE_TENANT_ID := ""; + modulepar Json.String PX_CSE_TENANT_ID := ""; - modulepar Json.String PX_CSE_TENANT_NAME_1 := "tenantX"; + modulepar Json.String PX_CSE_TENANT_NAME_1 := "tenantX"; - modulepar Json.String PX_CSE_CUSTOMER_ID_2 := "" + modulepar Json.String PX_CSE_CUSTOMER_ID_2 := "customer02" - modulepar Json.String PX_CSE_CUSTOMER_NAME_2 := "customerName02"; + modulepar Json.String PX_CSE_CUSTOMER_NAME_2 := "customerName02"; - modulepar Json.String PX_CSE_TENANT_NAME_2 := "tenantY"; + modulepar Json.String PX_CSE_TENANT_NAME_2 := "tenantY"; - modulepar Json.String PX_CSE_CUSTOMER_ID_3 := "" + modulepar Json.String PX_CSE_CUSTOMER_ID_3 := "customer03" - modulepar Json.String PX_CSE_CUSTOMER_NAME_3 := "customerName03"; + modulepar Json.String PX_CSE_CUSTOMER_NAME_3 := "customerName03"; - modulepar Json.String PX_CSE_TENANT_NAME_3 := "tenantName03"; + modulepar Json.String PX_CSE_TENANT_NAME_3 := "tenantName03"; - modulepar Json.String PX_NON_EXISTENT_TENANT_ID := "9344"; + modulepar Json.String PX_CSE_SITE_ID_1 := "site-001"; - modulepar Json.String PX_NEW_CUSTOMER_ID := ""; + modulepar Json.String PX_CSE_SITE_ID_2 := "site-002"; - modulepar Json.String PX_NEW_CUSTOMER_NAME := "newCustomer"; + modulepar Json.String PX_NON_EXISTENT_TENANT_ID := "9344"; - modulepar Json.String PX_NEW_TENANT_NAME := "newTenat"; + modulepar Json.String PX_NEW_CUSTOMER_ID := ""; - modulepar Json.String PX_SITE_ID_1 := "209153c9-0c28-428f-930f-d61328c30ffd"; + modulepar Json.String PX_NEW_CUSTOMER_NAME := "newCustomer"; - modulepar Json.String PX_SITE_ID_2 := "77e093bc-830c-4bcc-9ad8-6c3eff048335"; + modulepar Json.String PX_NEW_TENANT_NAME := "newTenat"; + + modulepar Json.String PX_SITE_ID_1 := "209153c9-0c28-428f-930f-d61328c30ffd"; - modulepar Json.String PX_SITE_ID_3 := "7d6b6123-b3b7-413e-ae73-b8bb349bda46"; + modulepar Json.String PX_SITE_ID_2 := "77e093bc-830c-4bcc-9ad8-6c3eff048335"; - modulepar Json.Integer PX_CPU_QUOTA_1 := 4; + modulepar Json.String PX_SITE_ID_3 := "7d6b6123-b3b7-413e-ae73-b8bb349bda46"; - modulepar Json.Integer PX_MEMORY_QUOTA_1 := 2048; + modulepar Json.Integer PX_CPU_QUOTA_1 := 4; - modulepar Json.Integer PX_DISK_QUOTA_1 := 50; + modulepar Json.Integer PX_MEMORY_QUOTA_1 := 2048; - modulepar Json.Integer PX_CPU_QUOTA_2 := 4; + modulepar Json.Integer PX_DISK_QUOTA_1 := 50; - modulepar Json.Integer PX_MEMORY_QUOTA_2 := 2048; + modulepar Json.Integer PX_CPU_QUOTA_2 := 4; - modulepar Json.Integer PX_DISK_QUOTA_2 := 50; + modulepar Json.Integer PX_MEMORY_QUOTA_2 := 2048; - modulepar Json.Integer PX_CPU_QUOTA_3 := 4; + modulepar Json.Integer PX_DISK_QUOTA_2 := 50; - modulepar Json.Integer PX_MEMORY_QUOTA_3 := 2048; + modulepar Json.Integer PX_CPU_QUOTA_3 := 4; - modulepar Json.Integer PX_DISK_QUOTA_3 := 50; + modulepar Json.Integer PX_MEMORY_QUOTA_3 := 2048; - modulepar Json.String PX_NON_EXISTENT_SITE_ID := "9344"; + modulepar Json.Integer PX_DISK_QUOTA_3 := 50; - modulepar Json.AnyURI PX_CSE_SUB_CALLBACK_URI := "http://127.0.0.1/callback"; + modulepar Json.String PX_NON_EXISTENT_SITE_ID := "9344"; - modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "0787"; + modulepar Json.AnyURI PX_CSE_SUB_CALLBACK_URI := "http://127.0.0.1/callback"; + + modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "0787"; modulepar Json.String PX_NON_EXISTENT_SUBSCRIPTION_ID := "NON_EXISTENT_SUBSCRIPTION_ID"; diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn index 8e14ba566d97e349e4ae8205fd9fa6dd9d138124..a0421e515cdfd1feb81b4eaf377c83758753e886 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_Templates.ttcn @@ -19,7 +19,7 @@ module SelfServiceEnablementAPI_Templates { in template (omit) Json.String p_tenantId, in Json.String p_tenantName, in template (omit) ResourceInfo p_resourceUseInfo := omit, - in template (omit) SiteInfo p_siteList := omit + in template (omit) SiteInfoList p_siteList := omit ) := { customerId := p_customerId, customerName := p_customerName, @@ -37,7 +37,7 @@ module SelfServiceEnablementAPI_Templates { template Json.String p_tenantId := *, template (present) Json.String p_tenantName := ?, template ResourceInfo p_resourceUseInfo := *, - template SiteInfo p_siteList := * + template SiteInfoList p_siteList := * ) := { customerId := p_customerId, customerName := p_customerName, @@ -333,7 +333,7 @@ module SelfServiceEnablementAPI_Templates { } // End of template mw_site_resource_use_info template (value) ExpiryNotification m_cse_expiry_notification( - in template (value) LinkExpiry p_links, + in template (value) LinksExpiry p_links, in template (value) TimeStamp p_expiryDeadline ) := { notificationType := "ExpiryNotification", @@ -342,7 +342,7 @@ module SelfServiceEnablementAPI_Templates { } // End of template m_expiry_notification template (present) ExpiryNotification mw_cse_expiry_notification( - template (present) LinkExpiry p_links := ?, + template (present) LinksExpiry p_links := ?, template (present) TimeStamp p_expiryDeadline := ? ) := { notificationType := "ExpiryNotification", @@ -467,13 +467,13 @@ module SelfServiceEnablementAPI_Templates { diskRemain := p_diskRemain } // End of template mw_resource_info - template (value) LinkExpiry m_link_expiry( + template (value) LinksExpiry m_link_expiry( in template (value) LinkType p_subscription ) := { subscription := p_subscription } //End of temaplate m_link_expiry - template (present) LinkExpiry mw_link_expiry( + template (present) LinksExpiry mw_link_expiry( template (present) LinkType p_subscription := ? ) := { subscription := p_subscription diff --git a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn index a6f9d63fc75aba35abed5e45b47aab25c9acb4a1..668f1e0b483c877d79c61fb2043d24e9a5c3770a 100644 --- a/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/SelfServiceEnablementAPI/ttcn/SelfServiceEnablementAPI_TypesAndValues.ttcn @@ -3,6 +3,9 @@ module SelfServiceEnablementAPI_TypesAndValues { // JSON import from Json all; + // LibCommon + import from LibCommon_BasicTypesAndValues all; + // LibMec import from LibMec_TypesAndValues all; @@ -15,7 +18,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantName Name of the tenant * @param resourceUseInfo Resource in the MEC system that can be used by the tenant * @param siteList A list of edge sites that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.2-1: Definition of type TenantInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.2.2-1: Attributes of type TenantInfo */ type record TenantInfo { Json.String customerId, @@ -24,7 +27,7 @@ module SelfServiceEnablementAPI_TypesAndValues { Json.String tenantId optional, Json.String tenantName, ResourceInfo resourceUseInfo optional, - SiteInfo siteList optional + SiteInfoList siteList optional } type set of TenantInfo TenantInfoList; @@ -33,7 +36,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param cpuQuota Allowed number of CPUs in the MEC system that can be used by the tenant * @param memoryQuota Allowed amount of memory (MB) in the MEC system that can be used by the tenant * @param diskQuota Allowed amount of disk (GB) in the MEC system that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.3-1: Definition of type ResourceQuotaInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.2.3-1: Attributes of type ResourceQuotaInfo */ type record ResourceQuotaInfo { Json.Integer cpuQuota optional, @@ -47,7 +50,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param cpuQuota Allowed number of CPUs in the MEC system that can be used by the tenant * @param memoryQuota Allowed amount of memory (MB) in the MEC system that can be used by the tenant * @param diskQuota Allowed amount of disk (GB) in the MEC system that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.2.4-1: Definition of type SiteResourceQuotaInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.2.4-1: Attributes of type SiteResourceQuotaInfo */ type record SiteResourceQuotaInfo { Json.String siteId, @@ -68,7 +71,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantId Identifier of the tenant * @param notificationTrigger Set for trigger-based event notification reporting * @param expiryDeadline The expiration time of the subscription determined by the CSE - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2-1: Definition of type ResourceUsageSubscription + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.2-1: Attributes of type ResourceUsageSubscription */ type record ResourceUsageSubscription { Json.String subscriptionType, @@ -95,7 +98,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param tenantId Identifier of the tenant * @param notificationTrigger Set for trigger-based event notification reporting * @param expiryDeadline The expiration time of the subscription determined by the CSE - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.3-1: Definition of type SiteResourceUsageSubscription + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.3-1: Attributes of type SiteResourceUsageSubscription */ type record SiteResourceUsageSubscription { Json.String subscriptionType, @@ -115,7 +118,7 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents a list of links related to currently existing subscriptions for the service consumer * @param _links List of hyperlinks related to the resource - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.4-1: Attributes of type SubscriptionLinkList + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.4-1: Attributes of type SubscriptionLinkList */ type record SubscriptionLinkList { LinksSub links @@ -130,7 +133,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param customerId Identifier to uniquely specify the customer for the subscription * @param tenantId Identifier of the tenant * @param resourceUseInfo Resource usage in the MEC system by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.2-1: Attributes of type ResourceUsageNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.2-1: Attributes of type ResourceUsageNotification */ type record ResourceUsageNotification { Json.String notificationType, @@ -148,7 +151,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.2-1: Attributes of type ResourceUseInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.2-1: Attributes of type ResourceUseInfo */ type record ResourceUseInfo { Json.Integer cpuUsed optional, @@ -166,7 +169,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param customerId Identifier to uniquely specify the customer for the subscriptionc * @param tenantId Identifier of the tenant * @param resourceUseInfo Resource usage in the MEC system by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type SiteResourceUsageNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.3-1: Attributes of type SiteResourceUsageNotification */ type record SiteResourceUsageNotification { Json.String notificationType, @@ -185,7 +188,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param memoryRemain Remaining amount of memory (MB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type SiteResourceUseInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.3-1: Attributes of type SiteResourceUseInfo */ type record SiteResourceUseInfo { Json.String siteId, @@ -196,17 +199,18 @@ module SelfServiceEnablementAPI_TypesAndValues { Json.Integer diskUsed optional, Json.Integer diskRemain optional } + type set of SiteResourceUseInfo SiteResourceUseInfoList; /** * @desc This type represents a notification from CSE with regards to expiry of an existing subscription * @param notificationType Shall be set to "ExpiryNotification" * @param _links Object containing hyperlinks related to the resource * @param expiryDeadline Time stamp - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.4-1: Attributes of type ExpiryNotification + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.4-1: Attributes of type ExpiryNotification */ type record ExpiryNotification { Json.String notificationType, - LinkExpiry links, + LinksExpiry links, TimeStamp expiryDeadline } with { variant (links) "name as '_links'"; @@ -216,13 +220,13 @@ module SelfServiceEnablementAPI_TypesAndValues { * @desc This type represents the information on an edge site * @param siteId Identifier of an edge site * @param resourceInfo Resource information in the edge site that is associated with a specific tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.2-1: Attributes of type SiteInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.2-1: Attributes of type SiteInfo */ type record SiteInfo { Json.String siteId, - ResourceInfo resourceInfo + ResourceInfo resourceInfo optional } - + type set of SiteInfo SiteInfoList; /** * @desc This type represents the resource information in an edge site or a MEC system that is associated with a tenant * @param cpuQuota Allowed number of CPUs that can be used by the tenant @@ -234,7 +238,7 @@ module SelfServiceEnablementAPI_TypesAndValues { * @param diskQuota Allowed amount of disk (GB) that can be used by the tenant * @param diskUsed Used amount of disk (GB) by the tenant * @param diskRemain Remaining amount of disk (GB) that can be used by the tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.4.3-1: Attributes of type ResourceInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.3-1: Attributes of type ResourceInfo */ type record ResourceInfo { Json.Integer cpuQuota optional, @@ -249,10 +253,11 @@ module SelfServiceEnablementAPI_TypesAndValues { } /** - * @desc This type represents the information on an edge site - * @param siteId Identifier of an edge site - * @param resourceInfo Resource information in the edge site that is associated with a specific tenant - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.2-1: Attributes of type SiteInfo + * @desc This type represents the set for trigger-based event notification reporting. + * @param triggerType Trigger for the notification + * @param threshold Threshold for trigger-based event reporting + * @param greaterOrLess Indicator for the triggering condition + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.2-1: Attributes of type NotificationTrigger */ type record NotificationTrigger { TriggerType triggerType, @@ -262,7 +267,7 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc Trigger for the notification - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2-1: Enumeration TriggerType + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.2-1: Enumeration TriggerType */ type enumerated TriggerType { e_tt_ten (10), // 10 = Notification trigged based on the number of used CPUs @@ -277,8 +282,9 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc Hyperlink related to the resource - * @member subscription URI identifying the subscription for the test notification - * @see ETSI GS MEC 048 V3.2.1 (2025-09) : Definition of type Links + * @param self Self-referring URI + * @param subscription URI identifying the subscription for the test notification + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.4-1: Attributes of type LinksSub */ type record LinksSub { LinkType self_, @@ -289,9 +295,9 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc The service consumer's subscriptions - * @member href The URI referring to the subscription - * @member subscriptionType Type of the subscription - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.4-11: Type Subscription + * @param href The URI referring to the subscription + * @param subscriptionType Type of the subscription + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.4-1: Attributes of type Subscription */ type record Subscription { @@ -302,8 +308,8 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc Hyperlink related to the resource - * @member subscription URI identifying the subscription for the test notification - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.3.2: Attributes of the Links + * @param self Self-referring URI + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.3.2-1: Attributes of type Links */ type record Links { LinkType self_ @@ -313,8 +319,8 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents a type of link - * @member href URI referring to a resource - * @see ETSI GS MEC 048 V3.2.1 (2025-09) : Definition of type LinkType + * @param href URI referring to a resource + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.6-1 : Attributes of type LinkType */ type record LinkType { Json.AnyURI href @@ -323,7 +329,7 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents the identifier of an edge site. * @param siteId Identifier of an edge site - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Table 6.5.5-1: Attributes of type SiteInfo + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.5-1: Attributes of type SiteId */ type record SiteId { Json.String siteId @@ -332,16 +338,21 @@ module SelfServiceEnablementAPI_TypesAndValues { /** * @desc This type represents configuration for the delivery of subscription notifications over Websockets - * @member websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications - * @member requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested - * @see ETSI GS MEC 048 V3.2.1 (2025-09) Type: WebsockNotifConfig + * @param websocketUri Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications + * @param requestWebsocketUri Set to true by the service consumer to indicate that Websocket delivery is requested + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.5.4-1 Attributes of type WebsockNotifConfig */ type record WebsockNotifConfig { Json.AnyURI websocketUri optional, Json.Bool requestWebsocketUri optional } - type record LinkExpiry { + /** + * @desc This type represents the hyperlink related to the resource. + * @param subscription URI identifying the subscription which has expired. + * @see ETSI GS MEC 048 V3.2.1 (2025-08) Table 6.4.4-1: Attributes of type LinksExpiry + */ + type record LinksExpiry { LinkType subscription } diff --git a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn index b1642532b81aa53a25d6289458c4248c312d6f16..d8b17f46eb75279100f12b7f13c0c65460031ece 100644 --- a/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn +++ b/ttcn/LibMec/TrafficManagementAPI/ttcn/TrafficManagementAPI_Functions.ttcn @@ -66,6 +66,7 @@ module TrafficManagementAPI_Functions { // var charstring_list v_header_location; tc_ac.stop; log("f_create_bw_allocation_resource: BwInfo resource created: ", v_response); + var charstring_list v_header_location; f_get_header(valueof(v_response.response.header), "Location", v_header_location); p_bw_allocation_id := regexp( v_header_location[0],