OneM2M_Templates.ttcn 130 KB
Newer Older
1 2 3 4 5 6 7 8
/**
 *  Copyright Notification
 *  No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
 *  The copyright and the foregoing restriction extend to reproduction in all media.
 *  © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
 *  All rights reserved.
 *  
 *  @author     ETSI
9 10
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
 *              $Id: OneM2M_Templates.ttcn 347 2017-08-11 08:48:20Z reinaortega $
11 12 13 14 15 16 17 18 19 20
 *  @desc       Module containing templates for oneM2M
 *
 */
module OneM2M_Templates {

	import from XSD all;
	import from OneM2M_Types all;
	import from OneM2M_TypesAndValues all;
	//import from OneM2M_AdditionalTypes all;
	import from OneM2M_Pixits all;
21
	//import from OneM2M_Functions all;
22

23
		
24 25 26 27 28 29
	/**
	 * @desc Get a converted to string random number 
	 * @param p_lower Lower limit 
	 * @param p_upper Upper limit
	 * @return Random number converted to string
	 * @verdict 
30
	 */
31 32 33 34 35
	function f_rnd(in integer p_lower, in integer p_upper) return charstring {
		
		return int2str(float2int(rnd() * int2float(p_upper - p_lower + 1)) + p_lower);	
	}

36 37

	/* Templates */
38
	
39
	group Primitives {
40 41 42 43
		/** 
		 * @desc Base template for request sending operations
		 * @param p_requestPrimitive
		 */
44
		template (value) MsgOut m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
45 46 47 48 49
			primitive := { requestPrimitive := p_requestPrimitive},
			host := PX_SUT_ADDRESS,
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := PX_PROTOCOL_BINDING,
			serialization := PX_SERIALIZATION, 
50
			forcedFields := p_forcedFields
51 52 53 54 55 56
		};
    	
		/** 
		 * @desc Base template for response sending operations
		 * @param p_responsePrimitive
		 */
57
		template (value) MsgOut m_response(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
58 59 60 61 62
			primitive := { responsePrimitive := p_responsePrimitive},
			host := PX_SUT_ADDRESS,
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := PX_PROTOCOL_BINDING,
			serialization := PX_SERIALIZATION, 
63
			forcedFields := p_forcedFields
64
		};
65 66 67 68 69 70 71 72 73 74 75 76 77 78
		
		/** 
		 * @desc Base template for response sending operations
		 * @param p_responsePrimitive
		 */
		template (value) MsgOut m_httpResponse(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := {
			primitive := { responsePrimitive := p_responsePrimitive},
			host := PX_SUT_ADDRESS,
			xmlNamespace := PX_XML_NAMESPACE,
			protocolBinding := "HTTP",
			serialization := PX_SERIALIZATION, 
			forcedFields := p_forcedFields
		};
		
79 80 81
		template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive) := {
			primitive := { requestPrimitive := p_requestPrimitive}
		};
82 83 84 85 86
    	
		/** 
		 * @desc Base template for response receiving operations
		 * @param p_responsePrimitive
		 */
87
		template MsgIn mw_response(in template (present) ResponsePrimitive p_responsePrimitive := ?) := {
88 89 90
			primitive := { responsePrimitive := p_responsePrimitive}
		};
    	
91
	}//end of group primitives
92 93 94 95
	
	group RequestPrimitives { 
		
		group Retrieve {
96

97 98 99 100
			/**
			 * @desc Base RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
101
			 */
102
			template (value) RequestPrimitive m_retrieveResource(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
103
				operation := int2,
104
				to_ := p_targetResourceAddress,
105
				from_ := p_originator,
106 107
				requestIdentifier := "m_retrieveResource" & f_rnd(1, 1000000),
				resourceType := omit,
108
				primitiveContent := omit,
109
				role := omit, 
110 111 112 113 114 115 116 117 118 119 120
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
121
				discoveryResultType := omit
122
			};
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
			
			/**
			 * @desc Base Receive RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 */
			template RequestPrimitive mw_retrieveResource(XSD.ID p_targetResourceAddress) := {
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := ?,
				requestIdentifier := ?,
				resourceType := ?,
				primitiveContent := ?,
				role := *, 
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *
			};
149
        	
150 151 152 153 154
			/**
			 * @desc RETRIEVE request primitive for a single attribute in To field ("targetResourceAddress#AttributeName")
			 * @param p_targetResourceAddress Target resource address (including "#AttributeName")
			 * @param p_originator Originator (from)
			 */
155 156 157 158 159 160
			template (value) RequestPrimitive m_retrieveResourceAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := p_originator,
				requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
				resourceType := omit,
161
				primitiveContent := omit, 
162
				role := omit,
163 164 165 166 167 168 169 170 171 172 173
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
174 175
				discoveryResultType := omit
			};
176
        	
177 178 179 180 181
			/**
			 * @desc RETRIEVE request primtive containing the target attributes in the primitiveContent field
			 * @param p_targetResourceAddress Target resource address 
			 * @param p_attributeList Target attribute list
			 * @param p_originator Originator (from)
182
			 */
183
			template (value) RequestPrimitive m_retrieveResourceAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
184
				operation := int2,
185
				to_ := p_targetResourceAddress,
186
				from_ := p_originator,
187 188
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
189
				primitiveContent := {attributeList := p_attributeList},
190
				role := omit,
191 192 193 194 195 196 197 198 199 200 201
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
202
				discoveryResultType := omit
203
			};
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
			
			/**
			  * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
			template (value) RequestPrimitive m_retrieveResourceFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieveResource := {
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
					filterUsage := p_filterUsage, 
					limit := omit
				}
			};
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
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
			/**
			  * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_originator Originator (from)
			  * @param p_filterUsage FilterUsage
			  * @param p_labels Labels
			 */
			template (value) RequestPrimitive m_retrieveResourceFilterUsageOptionLabel(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage, in Labels p_labels) modifies m_retrieveResource := {
				requestIdentifier := "m_retrieveResourceFilterUsageOptionLabel" & f_rnd(1, 1000000),
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := p_labels,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
					filterUsage := p_filterUsage, 
					limit := omit
				}
			};
			
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 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
			/**
			  * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
			template (value) RequestPrimitive m_retrieveResourceDiscResTypeFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) DiscResType p_discResType, in template (value) FilterUsage p_filterUsage) modifies m_retrieveResource := {
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := omit,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
					filterUsage := p_filterUsage,
					limit := omit
				},
				discoveryResultType := p_discResType
			};
			
			/**
				  * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field
				  * @param p_targetResourceAddress Target resource address 
				  * @param p_filterCriteria FilterCriteria
				  * @param p_originator Originator (from)
				 */
				template (value) RequestPrimitive m_retrieveResourceInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieveResource := {
					requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
					filterCriteria := {
						createdBefore := omit,
						createdAfter := omit,
						modifiedSince := omit,
						unmodifiedSince := omit,
						stateTagSmaller := omit,
						stateTagBigger := omit,
						expireBefore := omit,
						expireAfter := omit,
						labels := omit,
						resourceType := omit,
						sizeAbove := omit,
						sizeBelow := omit,
						contentType_list := {},
						attribute_list := {},
						filterUsage := omit,
						limit := omit
					}
				};
			
319
		}//end group Retrieve
320

321 322 323
		group Update {
    		
			template (value) RequestPrimitive m_update := {
324 325
				operation := int3,
				to_ := "NotInitialized",
326
				from_ := "NotInitialized",
327
				requestIdentifier := "m_update",
328
				resourceType := omit,
329
				primitiveContent:= omit,
330
				role := omit, 
331 332 333 334 335 336 337 338 339 340 341
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
342 343
				discoveryResultType := omit
			};
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
			
						
			template RequestPrimitive mw_update(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int3,
				to_ := p_to,
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
				primitiveContent:= ?,
				role := *, 
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *
			};
367 368 369 370 371
        	
			/**
			 * @desc Base UPDATE request primitive for Ae resource
			 */
			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
372
				requestIdentifier := "m_updateAe",
373
				primitiveContent:= {aE := m_contentUpdateAe}
374
			};
375 376 377 378 379 380 381 382 383 384
			
						
			/**
			 * @desc Reception template for update Ae resource
			 */
			template RequestPrimitive mw_updateAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int2,
				primitiveContent:= {aE := ?}
			};
			 
385 386 387 388 389
        	
			/**
			 * @desc Base UPDATE request primitive for Container resource
			 */
			template (value) RequestPrimitive m_updateContainerBase modifies m_update:= {
390
				requestIdentifier := "m_updateContainer",
391 392 393
				primitiveContent:= {container := m_contentUpdateContainer}
			};
			
394 395 396 397 398 399 400 401
			/**
			 * @desc Base Reception template for update Container
			 */
			template RequestPrimitive mw_updateContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int3,
				primitiveContent := {container := ?}
			}; 
			
402 403 404 405
			/**
			 * @desc Base UPDATE request primitive for ContentInstance resource
			 */
			template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= {
406
				requestIdentifier := "m_updateContentInstance",
407
				primitiveContent:= {contentInstance := m_contentUpdateContentInstance}
408 409
			};
			
410 411 412
			/**
			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
			 */        				
413
			template (value) RequestPrimitive m_updateAcpBase modifies m_update := {
414
				requestIdentifier := "m_updateAcp",
415
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcp}
416 417 418
			};
			
			template (value) RequestPrimitive m_updateAcpPrivileges(in template(omit) SetOfAcrs p_privileges := omit, in template(omit) SetOfAcrs p_selfPrivileges := omit) modifies m_update := {
419
				requestIdentifier := "m_updateAcp",
420
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}
421 422
			};
			
423 424 425
			/**
			 * @desc Base UPDATE request primitive for Group resource
			 */
426
			template (value) RequestPrimitive m_updateGroupBase modifies m_update := {
427
				requestIdentifier := "m_updateGroup",
428 429 430 431 432 433 434
				primitiveContent:= {group_ := m_contentUpdateGroup}
			};
			
			/**
			 * @desc Base UPDATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := {
435
				requestIdentifier := "m_updateGroup",
436
				primitiveContent:= {cSEBase := m_contentUpdateCSEBase}
437 438
			};
			
439 440 441
			/**
			 * @desc Base UPDATE request primitive for Schedule resource
			 */
442
			template (value) RequestPrimitive m_updateScheduleBase modifies m_update := {
443
				requestIdentifier := "m_updateSchedule",
444
				primitiveContent:= {schedule := m_contentUpdateSchedule}
445 446
			};
			
447 448 449
			/**
			 * @desc Base UPDATE request primitive for PollingChannel resource
			 */
450
			template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := {
451
				requestIdentifier := "m_updatePollingChannel",
452
				primitiveContent:= {pollingChannel := m_contentUpdatePollingChannel}
453 454
			};
			
455 456 457
			/**
			 * @desc Base UPDATE request primitive for Subscription resource
			 */
458
			template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := {
459
				requestIdentifier := "m_updateSubscription",
460
				primitiveContent:= {subscription := m_contentUpdateSubscription}
461 462
			};
			
463
			template (value) RequestPrimitive m_updateLocationPolicy(XSD.ID p_locResourceAddress, in template (omit) AcpType p_accessControlPolicyIds, in template (value) XSD.Duration p_locationUpdatePeriod) modifies m_update := {
464 465
				to_ 				:= p_locResourceAddress,
				requestIdentifier	:= "m_updateLocationPolicy",
466
				primitiveContent	:= {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)}
467 468
			  };
        	
469
			template (value) RequestPrimitive m_updateNodeBase modifies m_update := {
470
				requestIdentifier := "m_updateNode",
471 472 473 474
				primitiveContent:= {node := m_contentUpdateNode}
			}
        	
			template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := {
475
			   requestIdentifier := "m_updateRemoteCSEBase",
476 477 478 479
			   primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
			}
        	
			template (value) RequestPrimitive m_updateAE modifies m_update := {
480
				requestIdentifier := "m_updateAE",
481 482 483 484
				primitiveContent := {aE := m_contentUpdateAe}
			}
        	
			template (value) RequestPrimitive m_updateAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_to := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_stemId := "") modifies m_update:= {
485
				requestIdentifier := testcasename() & "-m_updateAEAnnc",
486
				resourceType := int10002,
487
				primitiveContent := {aEAnnc := m_contentUpdateAEAnnc(p_appId,p_stemId)}
488
			};
489 490 491 492 493 494 495 496
		}//end group Update
    	
		group Create {

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
497
				requestIdentifier := testcasename() & "-m_create",
498 499
				resourceType := omit,
				primitiveContent := omit,
500
				role := omit,
501 502 503 504 505 506 507 508 509 510 511
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
512
				discoveryResultType := omit
513 514
			};
        	
515
			/**
516
			 * @desc Base Reception template for create operation
517
			 */
518
			template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
519
				operation := int1,
520 521
				to_ := p_to,
				from_ := p_from,
522
				requestIdentifier := ?,
523 524
				resourceType := ?,
				primitiveContent := ?,
525 526 527 528 529 530 531 532 533 534 535 536 537
				role := *,
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *
538 539 540 541 542 543 544 545 546 547 548 549 550 551
			}
			
			
			/**
			 * @desc Base CREATE request primitive for AEAnnc resource
			 * @param p_accessControlPolicyIds
			 * @param p_to
			 * @param p_from
			 * @param p_appId
			 * @param p_stemId
			 */
			template (value) RequestPrimitive m_createAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_to := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_stemId := "") modifies m_create:= {
				to_ := p_to,
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
552
				requestIdentifier := testcasename() & "-m_createAEAnnc",
553 554 555 556 557 558 559 560 561 562
				resourceType := int10002,
				primitiveContent := {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, valueof(p_to) & "/" & p_stemId)}
			};
			
			/**
			 * @desc Reception template for CREATE AEAnnc
			 */
			template RequestPrimitive mw_createAEAnnc(template (omit) XSD.ID p_from := omit, template (omit) XSD.ID p_to := omit, template (omit) AcpType p_accessControlPolicyIds := omit) modifies mw_create := {
				resourceType := int10002,
				primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
563
			};
564

565
			template (value) RequestPrimitive m_createAe(XSD.ID p_appId, template (omit) AcpType p_accessControlPolicyIds := omit,template (omit) XSD.ID p_from := omit, template (omit) ResourceName p_resourceName :=  c_aeAuxName, in template (omit) PoaList p_poaList := omit) modifies m_create := {
566
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
567
				requestIdentifier := testcasename() & "-m_createAe",
568
				resourceType := int2,
569
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds,p_resourceName, p_appId, p_poaList)}
570
			};
571
        	
572 573 574
			/**
			 * @desc Reception template for AE registration
			 */
575
			template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?, template AE_optional p_ae := ?) modifies mw_create := {
576
				resourceType := int2,
577
				primitiveContent := {aE := p_ae}
578 579 580 581
			};  
			        	
			template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := {
				from_ := PX_AE1_ID_STEM,//TODO We should use omit, "s", or "c"
582
				requestIdentifier := testcasename() & "-m_createAe",
583 584
				resourceType := int2,
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds, c_aeAuxName, -, p_poaList)}
585
			};
586
        	
587 588 589
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource
			 */
590
			template (value) RequestPrimitive m_createAcpBase modifies m_create := {
591
				requestIdentifier := testcasename() & "-m_createAcp",
592
				resourceType := int1,
593
				primitiveContent := {accessControlPolicy := m_contentCreateAcp ()}
594 595
			};
				
596
			template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit)  XSD.String p_name := c_defaultAccessControlPolicyResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) modifies m_create := {
597
				to_ := p_parentResourceAddress,
598
				requestIdentifier := testcasename() & "-m_createAcp",
599
				resourceType := int1,
600 601 602 603 604 605 606 607 608 609 610
				primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)}
			};
        	
			/**
			 * @desc Reception template for CREATE AcpAnnc
			 */
			template RequestPrimitive mw_createAccessControlPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				to_ := p_to,
				from_ := p_from,
				resourceType := int10002,
				primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnnc(-)}
611
			};
612
        	
613 614 615 616
       	
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
			 */
617
			template (value) RequestPrimitive m_createAcpAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) modifies m_create := {
618
				requestIdentifier := testcasename() & "-m_createAcpAux",
619
				resourceType := int1,
620
				primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}
621
			};
622
        	
623 624 625
			/*template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
				from_ := PX_SUPER_USER,
				requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000),
626
				resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all
627 628 629 630 631 632 633
				primitiveContent := {cSEBase := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}
			};*/
			
			/**
			 * @desc Base CREATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := {
634
				requestIdentifier := testcasename() & "-m_createCSEBase",
635 636
				resourceType := int5,
				primitiveContent := {cSEBase := m_contentCreateCSEBase}
637 638
			};
        	
639 640 641 642
       	
			/**
			 * @desc Base CREATE request primitive for Container resource
			 */
643
			template (value) RequestPrimitive m_createContainerBase modifies m_create := {
644
				requestIdentifier := testcasename() & "-m_createContainer",
645
				resourceType := int3,
646 647 648 649 650 651
				primitiveContent := {container := m_contentCreateContainer}
			};
			
			/**
			 * @desc Base CREATE request primitive for remoteCSE resource
			 */
652
			template (value) RequestPrimitive m_createRemoteCSEBase(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) ResourceName p_resourceName :=  c_defaultRemoteCSEResourceName, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE1_ID) modifies m_create := {
653
				requestIdentifier := testcasename() & "-m_createRemoteCSE",
654 655 656 657
				resourceType := int16,
				primitiveContent := {remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
			};
			
658 659 660
			/**
			 * @desc CREATE request primitive for remoteCSE resource
			 */
661
			template RequestPrimitive mw_createRemoteCSEBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
662 663 664 665
				resourceType := int16,
				primitiveContent := ?//{remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
			};
			
666 667 668 669 670
			/**
			 * @desc CREATE request primitive for Container resource wiht no resourceName provided
			 */
			template (value) RequestPrimitive m_createContainer_noResourceName modifies m_createContainerBase := {
				primitiveContent := {container := m_contentCreateContainer(omit)}
671 672
			};
	
673
			template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultContainerResourceName) modifies m_create := {
674
				to_ := p_parentResourceAddress,
675
				requestIdentifier := testcasename() & "-m_createContainer",
676
				resourceType := int3,
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693
				primitiveContent := {container := m_contentCreateContainer(p_resourceName)}
			};
        	
			/**
			 * @desc Reception template for CREATE Container
			 */
			template RequestPrimitive mw_createContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int3,
				primitiveContent := {container := ?}
			};  
			
			/**
			 * @desc Base Reception template for CREATE ContainerAnnc
			 */
			template RequestPrimitive mw_createContainerAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10003,
				primitiveContent := {containerAnnc := mw_contentCreateContainerAnncBase}
694
			};
695
        	
696 697 698 699
			/**
			 * @desc Base CREATE request primitive for Content Instance resource
			 */
			template (value) RequestPrimitive m_createContentInstanceBase modifies m_create := {
700
				requestIdentifier := testcasename() & "-m_createContentInstance",
701 702 703 704 705 706 707 708 709 710 711
				resourceType := int4,
				primitiveContent := {contentInstance := m_contentCreateContentInstance}
			};
				
			/**
			 * @desc CREATE request primitive for Content Instance resource with no resourceName provided
			 */
			template (value) RequestPrimitive m_createContentInstance_noResourceName modifies m_createContentInstanceBase := {
				primitiveContent := {contentInstance := m_contentCreateContentInstance(omit)}
			};
    		
712 713 714
			template (value) RequestPrimitive m_createContentInstance(XSD.ID p_parentResourceAddress, XSD.String p_primitiveContent) modifies m_create := {
				to_ := p_parentResourceAddress,
				from_ := "admin:admin",
715
				requestIdentifier := testcasename() & "-m_createContentInstance",
716
				resourceType := int4,
717
				primitiveContent := {contentInstance := m_contentCreateContentInstance(-, p_primitiveContent)}
718
			};
719
    		
720 721 722 723 724 725
			/**
			 * @desc Reception template for CREATE ContentInstanceAnnc
			 */
			template RequestPrimitive mw_createContentInstanceAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10014,
				primitiveContent := {contentInstanceAnnc := ?}
726 727 728 729 730 731 732 733 734
			}; 
		
			/**
			 * @desc Reception template for CREATE ContentInstance
			 */
			template RequestPrimitive mw_createContentInstance(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int4,
				primitiveContent := {contentInstance := ?}
			}; 
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752
			
			/**
			 * @desc Base Reception template for CREATE ContentInstanceAnnc
			 */
			template RequestPrimitive mw_createContentInstanceAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10014,
				primitiveContent := {contentInstanceAnnc := mw_contentCreateContentInstanceAnncBase}
			};  
			
			/**
			 * @desc Base CREATE request primitive for Delivery resource
			 */
			/*template (value) RequestPrimitive m_createDeliveryBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createDelivery" & f_rnd(1, 1000000),
				resourceType := int6,
				primitiveContent := {delivery := m_contentCreateDelivery()}
			};*/
        	    		
753 754 755 756
       	
			/**
			 * @desc Base CREATE request primitive for Group resource
			 */
757
			template (value) RequestPrimitive m_createGroupBase modifies m_create := {
758
				requestIdentifier := testcasename() & "-m_createGroup",
759
				resourceType := int9,
760
				primitiveContent := {group_ := m_contentCreateGroup (1, {"NotInitialized"}, omit, omit)}	//TODO: p_resourceId
761
			};
762
        	
763
			template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
764 765 766 767 768 769
															in template (value) ListOfURIs p_memberIds := {"NotInitialized"},
															in template (omit) AcpType p_accessControlPolicyIds,
															in template (omit) MemberType p_memberType := omit,
															in template (omit) ConsistencyStrategy p_consistencyStrategy := omit,
															in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit,
															in template (omit) XSD.String p_name := "MyGroup") modifies m_create := {
770
				requestIdentifier := testcasename() & "-m_createGroup",
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794
				resourceType := int9,
				primitiveContent := {group_ := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIds, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)}	//TODO: p_resourceId
			};
        	
			/**
			 * @desc Reception template for CREATE GroupAnnc
			 */
			template RequestPrimitive mw_createGroupAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10009,
				primitiveContent := {groupAnnc := ?}
			};  
			
			/**
			 * @desc Base Reception template for CREATE GroupAnnc
			 */
			template RequestPrimitive mw_createGroupAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10009,
				primitiveContent := {groupAnnc := mw_contentCreateGroupAnncBase}
			};
        	
			/**
			 * @desc Base CREATE request primitive for MgmtCmd resource
			 */
			template (value) RequestPrimitive m_createMgmtCmdBase modifies m_create := {
795
				requestIdentifier := testcasename() & "-m_createMgmtCmd",
796 797 798 799 800 801 802 803
				resourceType := int12,
				primitiveContent := {mgmtResource := m_contentCreateMgmtCmd (-,-)}
			};
			
			/**
			 * @desc Base CREATE request primitive for MgmtObj resource
			 */
			template (value) RequestPrimitive m_createMgmtObjBase modifies m_create := {
804
				requestIdentifier := testcasename() & "-m_createMgmtObj",
805 806 807 808 809 810 811 812
				resourceType := int13,
				primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-,-)}
			};
        	
			/**
			 * @desc CREATE request primitive for MgmtObj resource
			 */
			template (value) RequestPrimitive m_createMgmtObj modifies m_create := {
813
				requestIdentifier := testcasename() & "-m_createMgmtObj",
814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
				resourceType := int13,
				primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-, -)}
			};
        	
			/**
			 * @desc Reception template for CREATE MgmtObjAnnc
			 */
			template RequestPrimitive mw_createMgmtObjAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10013,
				primitiveContent := {announcedMgmtResource := ?}
			};  
			
			/**
			 * @desc Base Reception template for CREATE MgmtObjAnnc
			 */
			template RequestPrimitive mw_createMgmtObjAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10013,
				primitiveContent := {announcedMgmtResource := mw_contentCreateMgmtObjAnncBase}
			};  
			
			/**
			 * @desc Base CREATE request primitive for Node resource
			 */
			template (value) RequestPrimitive m_createNodeBase modifies m_create := {
838
				requestIdentifier := testcasename() & "-m_createNode",
839 840 841 842 843 844 845 846
				resourceType := int14,
				primitiveContent := {node := m_contentCreateNode(-, -, -) }
			};
        	
			/**
			 * @desc CREATE request primitive for Node resource
			 */
			template (value) RequestPrimitive m_createNode modifies m_create := {
847
				requestIdentifier := testcasename() & "-m_createNode",
848 849 850
				resourceType := int14,
				primitiveContent := {node := m_contentCreateNode(-,-,-) }
			};
851
        	
852 853 854 855 856 857 858
			/**
			 * @desc Reception template for CREATE NodeAnnc
			 */
			template RequestPrimitive mw_createNodeAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10014,
				primitiveContent := {nodeAnnc := ?}
			};  
859 860 861 862
       	
			/**
			 * @desc Base CREATE request primitive for PollingChannel resource
			 */
863
			template (value) RequestPrimitive m_createPollingChannelBase modifies m_create := {
864
				requestIdentifier := testcasename() & "-m_createPollingChannel",
865
				resourceType := int15,
866
				primitiveContent := {pollingChannel := m_contentCreatePollingChannel (-)}
867
			};
868
        	
869
			template (value) RequestPrimitive m_createPollingChannel(XSD.ID p_parentResourceAddress, in template (value)XSD.ID p_originatorId) modifies m_create := {
870 871
				to_ := p_parentResourceAddress,
				from_ := p_originatorId,
872
				requestIdentifier := testcasename() & "-m_createPollingChannel",
873
				resourceType := int15,
874
				primitiveContent := {pollingChannel := m_contentCreatePollingChannel ()}
875
			};
876
        	
877 878 879
			/**
			 * @desc Base CREATE request primitive for Schedule resource
			 */
880
			template (value) RequestPrimitive m_createScheduleBase modifies m_create := {
881
				requestIdentifier := testcasename() & "-m_createSchedule",
882
				resourceType := int18,
883
				primitiveContent := {schedule := m_contentCreateSchedule ({{"0 0 0,1,2 1 1 * *"}})}
884
			};
885
        	
886 887
			template (value) RequestPrimitive m_createSchedule(XSD.ID p_parentResourceAddress, in template (omit)  XSD.String p_name, in template (value) ScheduleEntries p_scheduleElement ) modifies m_create := {
				to_ := p_parentResourceAddress,
888
				requestIdentifier := testcasename() & "-m_createSchedule",
889
				resourceType := int18,
890
				primitiveContent := {schedule := m_contentCreateSchedule (p_scheduleElement, p_name)}
891
			};
892
        	
893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
			/**
			 * @desc Reception template for CREATE ScheduleAnnc
			 */
			template RequestPrimitive mw_createScheduleAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10018,
				primitiveContent := {scheduleAnnc := ?}
			};  
			
			/**
			 * @desc Base Reception template for CREATE ScheduleAnnc
			 */
			template RequestPrimitive mw_createScheduleAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10018,
				primitiveContent := {scheduleAnnc := mw_contentCreateScheduleAnncBase}
			};  
        	
			template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) modifies m_create := {
910
				requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRule",
911
				resourceType := int19,//FIXME Is this the correct value?
912
				primitiveContent := {serviceSubscribedAppRule := m_contentCreateServiceSubscribedAppRule (p_applicableCredIDs, p_allowedAppIDs, p_allowedAEs)}
913
			};
914
        	
915 916 917 918
			/**
			 * @desc Base CREATE request primitive for ServiceSubscribedAppRule Resource
			 */
			template (value) RequestPrimitive m_createServiceSubscribedAppRuleBase modifies m_create := {
919
				requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRuleBase",
920 921 922
				resourceType := int19,
				primitiveContent := {serviceSubscribedAppRule := m_contentCreateServiceSubscribedAppRuleBase}
			};
923 924 925 926
       	
			/**
			 * @desc Base CREATE request primitive for Subscription resource
			 */
927
			template (value) RequestPrimitive m_createSubscriptionBase modifies m_create := {
928
				requestIdentifier := testcasename() & "-m_createSubscription",
929
				resourceType := int23,
930
				primitiveContent := {subscription := m_contentCreateSubscription ({"NotInitialized"})}
931 932
			};
        	
933 934
			template (value) RequestPrimitive m_createSubscription(XSD.ID p_parentResourceAddress, in template (omit)  XSD.String p_name, in template (value) ListOfURIs p_notificationURI := {"NotInitialized"}) modifies m_create := {
				to_ := p_parentResourceAddress,
935
				requestIdentifier := testcasename() & "-m_createSubscription",
936
				resourceType := int23,
937
				primitiveContent := {subscription := m_contentCreateSubscription (p_notificationURI, p_name)}
938
			};
939 940 941 942 943 944 945 946
			
        	/**
			 * @desc Reception template for CREATE Subscription
			 */
			template RequestPrimitive mw_createSubscription(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int23,
				primitiveContent := {subscription := ?}
			};
947 948 949 950 951 952 953 954 955
        	
			template (value) RequestPrimitive m_createSubscriptionAdvanced(	XSD.ID p_parentResourceAddress, 
																		   in template (omit)  XSD.String p_name := omit,
																		   in template (value) ListOfURIs p_notificationURI,
																		   in template (omit) EventNotificationCriteria p_eventNotificationCriteria := omit,
																		   in template (omit) XSD.PositiveInteger p_expirationCounter := omit,
																		   in template (omit) BatchNotify p_batchNotify := omit,
																		   in template (omit) XSD.Boolean p_latestNotify := omit,
																		   in template (omit) XSD.AnyURI p_subscriberURI := omit,
956 957 958
																		   in template (omit) NotificationContentType p_notificationContentType := int1, 
																		   in template (omit) PendingNotification p_pendingNotification) modifies m_createSubscription := {
				primitiveContent := {subscription := m_contentCreateSubscriptionAdvanced (p_notificationURI, p_name, p_eventNotificationCriteria, p_expirationCounter, p_batchNotify, p_latestNotify, p_subscriberURI, p_notificationContentType, p_pendingNotification)}
959 960 961 962 963 964
			};
        	
			/**
			 * @desc Base CREATE request primitive for Location Policy resource
			 */
			template (value) RequestPrimitive m_createLocationPolicyBase modifies m_create := {
965
				requestIdentifier := testcasename() & "-m_createLocationPolicy",
966 967
				resourceType := int10,
				primitiveContent := {locationPolicy := m_contentCreateLocationPolicyBase}
968 969
			};
        	
970 971
			template (value) RequestPrimitive m_createLocationPolicy(in template (value) LocationSource p_locationSource, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.Duration p_locationUpdatePeriod, in template (omit) NodeID p_locationTargetID, in template (omit) XSD.AnyURI p_locationServerAddress) modifies m_create := {
        		
972
				requestIdentifier	:= testcasename() & "-m_createLocationPolicy", //the requestIdentifier is supposed to be set similar as "C190XX7T/001"  by prepending the AE-ID-Stem and slash(‘/’) in front of it
973
				resourceType		:= int10,
974
				primitiveContent	:= {locationPolicy := m_contentCreateLocationPolicy(p_locationSource, p_accessControlPolicyIds, p_locationUpdatePeriod, p_locationTargetID, p_locationServerAddress) },
975 976
				resultContent := int1//default
			};
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994
        	
			/**
			 * @desc Reception template for CREATE LocationPolicyAnnc
			 */
			template RequestPrimitive mw_createLocationPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10010,
				primitiveContent := {locationPolicyAnnc := ?}
			}; 
			
			/**
			 * @desc Base Reception template for CREATE LocationPolicyAnnc
			 */
			template RequestPrimitive mw_createLocationPolicyAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int10010,
				primitiveContent := {locationPolicyAnnc := mw_contentCreateLocationPolicyAnncBase}
			}; 
			
			template (value) RequestPrimitive m_createNotification(in template (value) Representation p_resourcePresentation, in template (omit)NotificationEventType p_notifEventType, in template (omit) XSD.AnyURI p_subscriptionReference, in template (omit) XSD.AnyURI p_notifForwardingURI) modifies m_create := {
995
			  requestIdentifier	:= testcasename() & "-m_createNotification",
996
			  primitiveContent	:= {notification := m_contentCreateNotification(p_resourcePresentation, p_notifEventType, p_subscriptionReference, p_notifForwardingURI)},
997 998 999
			  resultContent		:= int1 //default
        	  
			};
1000 1001 1002 1003 1004
			
			/**
			 * @desc Base CREATE request primitive for Stats Config resource
			 */
			template (value) RequestPrimitive m_createStatsConfigBase modifies m_create := {
1005
				requestIdentifier := testcasename() & "-m_createStatsConfig",
1006 1007 1008 1009 1010 1011 1012 1013
				resourceType := int22,
				primitiveContent := {statsConfig := m_contentCreateStatsConfigBase}
			};
			
			/**
			 * @desc Base CREATE request primitive for Stats Config resource
			 */
			template (value) RequestPrimitive m_createStatsCollectBase modifies m_create := {
1014
				requestIdentifier := testcasename() & "-m_createStatsCollect",
1015 1016 1017 1018 1019 1020 1021 1022
				resourceType := int21,
				primitiveContent := {statsCollect := m_contentCreateStatCollectBase}
			};
			
			/**
			 * @desc Base CREATE request primitive for M2mServiceSubscriptionProfile resource
			 */
			template (value) RequestPrimitive m_createM2mServiceSubscriptionProfileBase modifies m_create := {
1023
				requestIdentifier := testcasename() & "-m_createM2mServiceSubscriptionProfile",
1024 1025 1026 1027
				resourceType := int11,