AppEnablementAPI_Templates.ttcn 17.9 KB
Newer Older
YannGarcia's avatar
YannGarcia committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * @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
15
  import from AppEnablementAPI_Pixits all;
YannGarcia's avatar
YannGarcia committed
16

Yann Garcia's avatar
Yann Garcia committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  template (value) SecurityInfo m_security_info(
                                                in GrantTypesList p_grantTypes := { OAUTH2_CLIENT_CREDENTIALS },
                                                in TokenEndpoint p_tokenEndpoint := "/mecSerMgmtApi/security/MyTokenEndPoint"
                                                ) := {
    oAuth2Info := {
      grantTypes := p_grantTypes,
      tokenEndpoint := p_tokenEndpoint
    }
  } // End of template m_security_info

  template (present) SecurityInfo mw_security_info(
                                                   template (present) GrantTypesList p_grantTypes := ?,
                                                   template (present) TokenEndpoint p_tokenEndpoint := ?
                                                   ) := {
    oAuth2Info := {
      grantTypes := p_grantTypes,
      tokenEndpoint := p_tokenEndpoint
    }
  } // End of template mw_security_info

  template (value) TransportInfo_Endpoint m_end_point_uris(
                                                           in template (value) EndPointInfo_UriList p_uris
                                                           ) := {
    uris := p_uris
  } // End of template m_end_point_uris

  template (present) TransportInfo_Endpoint mw_end_point_uris(
                                                              template (present) EndPointInfo_UriList p_uris := ?
                                                              ) := {
    uris := p_uris
  } // End of template mw_end_point_uris
YannGarcia's avatar
YannGarcia committed
48

YannGarcia's avatar
YannGarcia committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
  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

Yann Garcia's avatar
Yann Garcia committed
95
96
  template (value) SubscriptionLinkList m_subscription_link_list(
                                                                 in template (value) Links p_links
YannGarcia's avatar
YannGarcia committed
97
  ) := {
Yann Garcia's avatar
Yann Garcia committed
98
    links := p_links
YannGarcia's avatar
YannGarcia committed
99
100
  } // End of template m_subscription_link_list

Yann Garcia's avatar
Yann Garcia committed
101
102
  template (present) SubscriptionLinkList mw_subscription_link_list(
                                                                    template (present) Links p_links := ?
YannGarcia's avatar
YannGarcia committed
103
  ) := {
Yann Garcia's avatar
Yann Garcia committed
104
    links := p_links
YannGarcia's avatar
YannGarcia committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
  } // 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

YannGarcia's avatar
YannGarcia committed
126
127
128
129
130
131
132
133
  template (value) AppTerminationNotificationSubscription m_app_termination_notif_subscription_invalid(
                                                                                                       in template (value) AppTerminationNotificationSubscription_CallbackReference p_callbackReference,
                                                                                                       in template (value) Self p_links,
                                                                                                       in template (value) AppInstanceId p_appInstanceId
                                                                                                       ) modifies m_app_termination_notif_subscription := {
    subscriptionType  := "InvalidAppTerminationNotificationSubscription"
  } // End of template m_app_termination_notif_subscription_invalid

YannGarcia's avatar
YannGarcia committed
134
135
136
137
138
139
140
141
142
143
144
  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
145
146
147
148
149
150
151
  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,
Yann Garcia's avatar
Yann Garcia committed
152
                                                  in template (value) SecurityInfo p_security
YannGarcia's avatar
YannGarcia committed
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
                                                  ) := {
    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
185
  template (value) DnsRule m_dns_rule(
YannGarcia's avatar
YannGarcia committed
186
187
188
189
190
                                      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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
                                      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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
  template (omit) SerAvailabilityNotificationSubscription m_srv_avail_notif_subscription(
                                                                                         in template (value) SerAvailabilityNotificationSubscription_CallbackReference p_callbackReference,
                                                                                         in template (omit) Self p_links := omit,
                                                                                         in template (omit) ServiceInfo p_filteringCriteria := omit
                                                                                         ) := {
    subscriptionType := "SerAvailabilityNotificationSubscription",
    callbackReference := p_callbackReference,
    links             := p_links,
    filteringCriteria := p_filteringCriteria
  } // End of template m_srv_avail_notif_subscription

  template (omit) SerAvailabilityNotificationSubscription m_srv_avail_notif_subscription_invalid(
                                                                                                 in template (value) SerAvailabilityNotificationSubscription_CallbackReference p_callbackReference,
                                                                                                 in template (omit) Self p_links := omit,
                                                                                                 in template (omit) ServiceInfo p_filteringCriteria := omit
                                                                                                 ) modifies m_srv_avail_notif_subscription := {
    subscriptionType := "InvalidSerAvailabilityNotificationSubscription"
  } // End of template m_srv_avail_notif_subscription_invalid

  template SerAvailabilityNotificationSubscription mw_srv_avail_notif_subscription(
                                                                                   template (present) SerAvailabilityNotificationSubscription_CallbackReference p_callbackReference := ?,
                                                                                   template Self p_links := *,
                                                                                   template  ServiceInfo p_filteringCriteria := *
                                                                                   ) := {
    subscriptionType := "SerAvailabilityNotificationSubscription",
    callbackReference := p_callbackReference,
    links             := p_links,
    filteringCriteria := p_filteringCriteria
  } // End of template mw_srv_avail_notif_subscription

  template (omit) TimingCaps m_timing_caps(
                                           in template (omit) TimeStamp p_timeStamp,
                                           in template (omit) NtpServersList p_ntpServers := omit,
                                           in template (omit) TimingCaps_PtpMastersList p_ptpMasters := omit
                                           ) := {
    timeStamp  := p_timeStamp,
    ntpServers := p_ntpServers,
    ptpMasters := p_ptpMasters
  } // End of template m_timing_caps

  template TimingCaps mw_timing_caps(
                                     template TimeStamp p_timeStamp := *,
                                     template NtpServersList p_ntpServers := *,
                                     template TimingCaps_PtpMastersList p_ptpMasters := *
                                     ) := {
    timeStamp  := p_timeStamp,
    ntpServers := p_ntpServers,
    ptpMasters := p_ptpMasters
  } // End of template mw_timing_caps

  template (value) CurrentTime m_current_time(
                                              in template (value) Seconds p_seconds,
                                              in template (value) NanoSeconds p_nanoSeconds,
                                              in template (value) TimeSourceStatus p_timeSourceStatus := TRACEABLE
                                              ) := {
    seconds          := p_seconds,
    nanoSeconds      := p_nanoSeconds,
    timeSourceStatus := p_timeSourceStatus
  } // End of template m_current_time

  template (present) CurrentTime mw_current_time(
                                                 template (present) Seconds p_seconds := ?,
                                                 template (present) NanoSeconds p_nanoSeconds := ?,
                                                 template (present) TimeSourceStatus p_timeSourceStatus := TRACEABLE
                                                 ) := {
    seconds          := p_seconds,
    nanoSeconds      := p_nanoSeconds,
    timeSourceStatus := p_timeSourceStatus
  } // End of template mw_current_time

YannGarcia's avatar
YannGarcia committed
287
288
289
290
291
  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 := {},
YannGarcia's avatar
YannGarcia committed
292
                                              in TrafficRule_Action p_action_ := FORWARD_AS_IS,
YannGarcia's avatar
YannGarcia committed
293
294
295
296
297
298
299
300
301
302
                                              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
YannGarcia's avatar
YannGarcia committed
303

YannGarcia's avatar
YannGarcia committed
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
  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
321
} // End of module AppEnablementAPI_Templates