AppEnablementAPI_Templates.ttcn 11.9 KB
Newer Older
YannGarcia's avatar
YannGarcia committed
/**
 * @desc The ETSI MEC ISG MEC011 Application Enablement API described using OpenAPI
 * @see http://www.etsi.org/deliver/etsi_gs/MEC/001_099/011/01.01.01_60/gs_mec011v010101p.pdf
 */
module AppEnablementAPI_Templates {

  // JSON
  import from JSON all;
 
  // LibCommon
  import from LibCommon_BasicTypesAndValues all;

  // LibMec/AppEna
  import from AppEnablementAPI_TypesAndValues all;
YannGarcia's avatar
YannGarcia committed
  import from AppEnablementAPI_Pixits all;
YannGarcia's avatar
YannGarcia committed

  template (present) ProblemDetails mw_problem_details(
                                                       template (present) JSON.String p_type := ?,
                                                       template (present) JSON.String p_title := ?,
                                                       template (present) UInt32 p_status := ?,
                                                       template (present) JSON.String p_detail := ?,
                                                       template (present) JSON.String p_instance := ?
                                                       ) := {
    type_    := p_type,
    title    := p_title,
    status   := p_status,
    detail   := p_detail,
    instance := p_instance
  } // End of template mw_problem_details

YannGarcia's avatar
YannGarcia committed
  template (omit) ServiceInfo m_service_info(
                                             in SerName p_serName,
                                             in ServiceInfo_Version p_version := PX_SERVICE_INFO_VERSION,
                                             in ServiceInfo_State p_state := PX_SERVICE_INFO_STATE,
                                             in SerializerTypes p_serializer := PX_SERIALIZER,
                                             in template (omit) SerInstanceId p_serInstanceId := omit,
                                             in template (omit) TransportId p_transportId := omit,
                                             in template (omit) TransportInfo p_transportInfo := omit,
                                             in template (omit) CategoryRef p_serCategory := omit
  ) := {
    serInstanceId     := p_serInstanceId,
    serName           := p_serName,
    serCategory       := p_serCategory,
    version           := p_version,
    state             := p_state,
    transportId       := p_transportId,
    transportInfo     := p_transportInfo,
    serializer        := p_serializer,
    scopeOfLocality   := omit,
    consumedLocalOnly := omit,
    isLocal           := omit
  } // End of template m_service_info

  template ServiceInfo mw_service_info(
                                       template (present) SerName p_serName := ?,
                                       template (present) ServiceInfo_Version p_version := ?,
                                       template (present) ServiceInfo_State p_state := ?,
                                       template (present) SerializerTypes p_serializer := ?,
                                       template SerInstanceId p_serInstanceId := *,
                                       template TransportId p_transportId := *,
                                       template TransportInfo p_transportInfo := *,
                                       template CategoryRef p_serCategory := *
  ) := {
    serInstanceId     := p_serInstanceId,
    serName           := p_serName,
    serCategory       := p_serCategory,
    version           := p_version,
    state             := p_state,
    transportId       := p_transportId,
    transportInfo     := p_transportInfo,
    serializer        := p_serializer,
    scopeOfLocality   := *,
    consumedLocalOnly := *,
    isLocal           := *
  } // End of template mw_service_info

  template (omit) SubscriptionLinkList m_subscription_link_list(
                                                                in template (value) Links p_links,
                                                                in template (omit) Subscriptions p_subscription := omit
  ) := {
    links := p_links,
    subscription := p_subscription
  } // End of template m_subscription_link_list

  template SubscriptionLinkList mw_subscription_link_list(
                                                          template (present) Links p_links := ?,
                                                          template Subscriptions p_subscription := *
  ) := {
    links := p_links,
    subscription := p_subscription
  } // End of template mw_subscription_link_list

  template (value) Self m_self(
                              in template (value) LinkType p_self_,
                              in template (value) JSON.Bool p_readOnly := false
  ) := {
    self_    := p_self_,
    readOnly := p_readOnly
  } // End of template m_self

  template (value) AppTerminationNotificationSubscription m_app_termination_notif_subscription(
                                                                                               in template (value) AppTerminationNotificationSubscription_CallbackReference p_callbackReference,
                                                                                               in template (value) Self p_links,
                                                                                               in template (value) AppInstanceId p_appInstanceId
  ) := {
    subscriptionType  := "AppTerminationNotificationSubscription",
    callbackReference := p_callbackReference,
    links             := p_links,
    appInstanceId     := p_appInstanceId
  } // End of template m_app_termination_notif_subscription

  template (present) AppTerminationNotificationSubscription mw_app_termination_notif_subscription(
                                                                                                  template (present) AppTerminationNotificationSubscription_CallbackReference p_callbackReference := ?,
                                                                                                  template (present) Self p_links := ?,
                                                                                                  template (present) AppInstanceId p_appInstanceId := ?
  ) := {
    subscriptionType  := "AppTerminationNotificationSubscription",
    callbackReference := p_callbackReference,
    links             := p_links,
    appInstanceId     := p_appInstanceId
  } // End of template mw_app_termination_notif_subscription

YannGarcia's avatar
YannGarcia committed
  template (value) TransportInfo m_transport_info(
                                                  in TransportInfo_Id p_id,
                                                  in TransportInfo_Name p_name,
                                                  in TransportTypes p_type_,
                                                  in TransportInfo_Protocol p_protocol,
                                                  in TransportInfo_Version p_version,
                                                  in template (value) TransportInfo_Endpoint p_endpoint,
                                                  in SecurityInfo p_security
                                                  ) := {
    id               := p_id,
    name             := p_name,
    description      := omit,
    type_            := p_type_,
    protocol         := p_protocol,
    version          := p_version,
    endpoint         := p_endpoint,
    security         := p_security,
    implSpecificInfo := omit
  } // End of template m_transport_info
  
  template (present) TransportInfo mw_transport_info(
                                                     template (present) TransportInfo_Id p_id := ?,
                                                     template (present) TransportInfo_Name p_name := ?,
                                                     template (present) TransportTypes p_type_ := ?,
                                                     template (present) TransportInfo_Protocol p_protocol := ?,
                                                     template (present) TransportInfo_Version p_version := ?,
                                                     template (present) TransportInfo_Endpoint p_endpoint := ?,
                                                     template (present) SecurityInfo p_security := ?
                                                     ) := {
    id               := p_id,
    name             := p_name,
    description      := *,
    type_            := p_type_,
    protocol         := p_protocol,
    version          := p_version,
    endpoint         := p_endpoint,
    security         := p_security,
    implSpecificInfo := *
  } // End of template mw_transport_info
  
YannGarcia's avatar
YannGarcia committed
  template (value) DnsRule m_dns_rule(
YannGarcia's avatar
YannGarcia committed
                                      in DnsRule_Id p_dnsRuleId := PX_DNS_RULE_ID,
                                      in DomainName p_domainName := PX_DOMAIN_NAME,
                                      in DnsRule_IpAddressType p_ipAddressType := PX_IP_ADDRESS_TYPE,
                                      in DnsRule_IpAddress p_ipAddress := PX_IP_ADDRESS,
                                      in Ttl p_ttl := PX_TTL,
YannGarcia's avatar
YannGarcia committed
                                      in DnsRule_State p_state := ACTIVE
                                      ) := {
    dnsRuleId     := p_dnsRuleId,
    domainName    := p_domainName,
    ipAddressType := p_ipAddressType,
    ipAddress     := p_ipAddress,
    ttl           := p_ttl,
    state         := p_state
  } // End of template m_dns_rule

  template (present) DnsRule mw_dns_rule(
                                         template (present) DnsRule_Id p_dnsRuleId := ?,
                                         template (present) DomainName p_domainName := ?,
                                         template (present) DnsRule_IpAddressType p_ipAddressType := ?,
                                         template (present) DnsRule_IpAddress p_ipAddress := ?,
                                         template (present) Ttl p_ttl := ?,
                                         template (present) DnsRule_State p_state := ?
                                         ) := {
    dnsRuleId     := p_dnsRuleId,
    domainName    := p_domainName,
    ipAddressType := p_ipAddressType,
    ipAddress     := p_ipAddress,
    ttl           := p_ttl,
    state         := p_state
  } // End of template mw_dns_rule

YannGarcia's avatar
YannGarcia committed
  template (value) TrafficRule m_traffic_rule(
                                              in TrafficRule_Id p_trafficRuleId,
                                              in TrafficRule_FilterType p_filterType := FLOW,
                                              in TrafficRule_Priority p_priority := 1,
                                              in TrafficFilterList p_trafficFilter := {},
                                              in TrafficRule_Action p_action_,
                                              in TrafficRule_State p_state := ACTIVE
                                              ) := {
    trafficRuleId := p_trafficRuleId,
    filterType    := p_filterType,
    priority      := p_priority,
    trafficFilter := p_trafficFilter,
    action_       := p_action_,
    dstInterface  := omit,
    state         := p_state
  } // End of template m_traffic_rule
  
  template (present) TrafficRule mw_traffic_rule(
                                                 template (present) TrafficRule_Id p_trafficRuleId := ?,
                                                 template (present) TrafficRule_FilterType p_filterType := ?,
                                                 template (present) TrafficRule_Priority p_priority := ?,
                                                 template (present) TrafficFilterList p_trafficFilter := ?,
                                                 template (present) TrafficRule_Action p_action_ := ?,
                                                 template (present) TrafficRule_State p_state := ?
                                                 ) := {
    trafficRuleId := p_trafficRuleId,
    filterType    := p_filterType,
    priority      := p_priority,
    trafficFilter := p_trafficFilter,
    action_       := p_action_,
    dstInterface  := *,
    state         := p_state
  } // End of template mw_traffic_rule
  
YannGarcia's avatar
YannGarcia committed
} // End of module AppEnablementAPI_Templates