OneM2M_Templates.ttcn 128 KB
Newer Older
1 2 3 4 5 6 7
/**
 *  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.
 *  
8
 *  @author     oneM2M
9
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
10
 *              $Id: OneM2M_Templates.ttcn 356 2017-08-21 12:25:14Z 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
    		primitive := { requestPrimitive := p_requestPrimitive},
46
    		host := PX_SUT_ADDRESS,
47 48 49
    		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
			primitive := { responsePrimitive := p_responsePrimitive},
59
			host := PX_SUT_ADDRESS,
60 61 62
			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 82 83 84 85 86 87 88 89 90
    	template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive) := {
    		primitive := { requestPrimitive := p_requestPrimitive}
    	};
    	
		/** 
		 * @desc Base template for response receiving operations
		 * @param p_responsePrimitive
		 */
		template MsgIn mw_response(in template (present) ResponsePrimitive p_responsePrimitive) := {
			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
				roleIDs := 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 122 123
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
124
				localTokenIDs := omit,
125
				tokenRequestIndicator := omit
126 127
			};
        	
128 129 130 131 132
			/**
			 * @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)
			 */
133
        	template (value) RequestPrimitive m_retrieveResourceAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
134
        		operation := int2,
135
        		to_ := p_targetResourceAddress,
136
        		from_ := p_originator,
137 138
        		requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
        		resourceType := omit,
139
				primitiveContent := omit, 
140
				roleIDs := omit,
141 142 143 144 145 146 147 148 149 150 151
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
152 153 154
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
155
				localTokenIDs := omit,
156
				tokenRequestIndicator := omit
157 158
        	};
        	
159 160 161 162 163
			/**
			 * @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)
164
			 */
165
			template (value) RequestPrimitive m_retrieveResourceAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
166
				operation := int2,
167
				to_ := p_targetResourceAddress,
168
				from_ := p_originator,
169 170
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
171
				primitiveContent := {attributeList := p_attributeList},
172
				roleIDs := omit,
173 174 175 176 177 178 179 180 181 182 183
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
184 185 186
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
187
				localTokenIDs := omit,
188
				tokenRequestIndicator := omit
189
			};
190 191 192 193 194 195 196 197 198 199
			
			/**
			  * @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 := {
200 201 202 203 204 205 206 207 208 209 210 211 212 213
					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 := {},
214
					filterUsage := p_filterUsage,
215 216 217 218 219 220 221
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
222 223 224
				}
			};
			
Pramod Kulkarni's avatar
Pramod Kulkarni committed
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
			/**
			  * @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
				}
			};
253 254 255 256 257 258 259 260 261
			/**
			  * @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 := {
262 263 264 265 266 267 268 269 270 271 272 273 274 275
					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 := {},
276
					filterUsage := p_filterUsage,
277 278 279 280 281 282 283
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
284 285 286 287 288 289 290 291 292 293 294 295 296
				},
				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 := {
297 298 299 300 301 302 303 304 305 306 307 308 309 310
						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 := {},
311
						filterUsage := omit,
312 313 314 315 316 317 318
						limit := omit,
						semanticsFilter_list := {},
						filterOperation := omit,
						contentFilterSyntax := omit,
						contentFilterQuery := omit,
						level := omit,
						offset := omit
319 320 321
					}
				};
			
322 323 324
    	}//end group Retrieve

    	group Update {
325 326
    		
    		template (value) RequestPrimitive m_update := {
327 328
				operation := int3,
				to_ := "NotInitialized",
329 330
				from_ := "NotInitialized",
				requestIdentifier := "m_update" & f_rnd(1, 1000000),
331
				resourceType := omit,
332
				primitiveContent:= omit,
333
				roleIDs := omit, 
334 335 336 337 338 339 340 341 342 343 344
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
345 346 347
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
348
				localTokenIDs := omit,
349
				tokenRequestIndicator := omit
350
			};
351
        	
352 353 354 355 356
			/**
			 * @desc Base UPDATE request primitive for Ae resource
			 */
			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
				requestIdentifier := "m_updateAe" & f_rnd(1, 1000000),
357
				primitiveContent:= {aE := m_contentUpdateAe}
358 359
			};
        	
360 361 362 363 364
			/**
			 * @desc Base UPDATE request primitive for Container resource
			 */
			template (value) RequestPrimitive m_updateContainerBase modifies m_update:= {
				requestIdentifier := "m_updateContainer" & f_rnd(1, 1000000),
365
				primitiveContent:= {container := m_contentUpdateContainer}
366
			};
367
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
368 369 370 371 372
			/**
			 * @desc Base UPDATE request primitive for ContentInstance resource
			 */
			template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= {
				requestIdentifier := "m_updateContentInstance" & f_rnd(1, 1000000),
373
				primitiveContent:= {contentInstance := m_contentUpdateContentInstance}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
374 375
			};
			
376 377 378
			/**
			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
			 */        				
379
			template (value) RequestPrimitive m_updateAcpBase modifies m_update := {
380
				requestIdentifier := "m_updateAcp" & f_rnd(1, 1000000),
381
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcp}
382 383
			};
			
384 385
			template (value) RequestPrimitive m_updateAcpPrivileges(in template(omit) SetOfAcrs p_privileges := omit, in template(omit) SetOfAcrs p_selfPrivileges := omit) modifies m_update := {
				requestIdentifier := "m_updateAcp" & f_rnd(1, 1000000),
386
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}
387 388
			};
			
389 390 391
			/**
			 * @desc Base UPDATE request primitive for Group resource
			 */
392
			template (value) RequestPrimitive m_updateGroupBase modifies m_update := {
393
				requestIdentifier := "m_updateGroup" & f_rnd(1, 1000000),
394
				primitiveContent:= {group_ := m_contentUpdateGroup}
395 396
			};
			
397 398 399 400 401
			/**
			 * @desc Base UPDATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := {
				requestIdentifier := "m_updateGroup" & f_rnd(1, 1000000),
402
				primitiveContent:= {cSEBase := m_contentUpdateCSEBase}
403 404
			};
			
405 406 407
			/**
			 * @desc Base UPDATE request primitive for Schedule resource
			 */
408
			template (value) RequestPrimitive m_updateScheduleBase modifies m_update := {
409
				requestIdentifier := "m_updateSchedule" & f_rnd(1, 1000000),
410
				primitiveContent:= {schedule := m_contentUpdateSchedule}
411 412
			};
			
413 414 415
			/**
			 * @desc Base UPDATE request primitive for PollingChannel resource
			 */
416
			template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := {
417
				requestIdentifier := "m_updatePollingChannel" & f_rnd(1, 1000000),
418
				primitiveContent:= {pollingChannel := m_contentUpdatePollingChannel}
419 420
			};
			
421 422 423
			/**
			 * @desc Base UPDATE request primitive for Subscription resource
			 */
424
			template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := {
425
				requestIdentifier := "m_updateSubscription" & f_rnd(1, 1000000),
426
				primitiveContent:= {subscription := m_contentUpdateSubscription}
427
			};
428
			
429
			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 := {
oneM2MTester Develop Team's avatar
oneM2MTester Develop Team committed
430
        	  	to_ 				:= p_locResourceAddress,
431
        	  	requestIdentifier	:= "m_updateLocationPolicy",
432
        	  	primitiveContent	:= {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)}
433
			  };
434
        	
435 436 437 438 439 440 441 442 443 444 445 446
        	template (value) RequestPrimitive m_updateNodeBase modifies m_update := {
				requestIdentifier := "m_updateNode" & f_rnd(1, 1000000),
				primitiveContent:= {node := m_contentUpdateNode}
        	}
        	
        	template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := {
        	   requestIdentifier := "m_updateRemoteCSEBase" & f_rnd(1, 1000000),
        	   primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
        	}
        	
        	template (value) RequestPrimitive m_updateAE modifies m_update := {
				requestIdentifier := "m_updateAE" & f_rnd(1, 1000000),
447
				primitiveContent := {aE := m_contentUpdateAe}
448
        	}
449 450 451 452 453 454
        	
        	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:= {
				requestIdentifier := testcasename() & "-m_updateAEAnnc" & f_rnd(1, 1000000),
				resourceType := int10002,
				primitiveContent := {aEAnnc := m_contentUpdateAEAnnc}
			};
455 456 457
    	}//end group Update
    	
    	group Create {
458 459 460 461 462

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
463
				requestIdentifier := testcasename() & "-m_create" & f_rnd(1, 1000000),
464 465
				resourceType := omit,
				primitiveContent := omit,
466
				roleIDs := omit,
467 468 469 470 471 472 473 474 475 476 477 478 479 480
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
481
				localTokenIDs := omit,
482
				tokenRequestIndicator := omit
483 484

			};
485
        	
486 487 488 489 490
			/**
			 * @desc Base Reception template for create operation
			 */
			template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int1,
491
				to_ := p_to,
492 493 494
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
495
				primitiveContent := ?,
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
				roleIDs := *,
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *,
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
				tokenRequestIndicator := *
			}
			
515 516
			
			/**
517 518 519 520 521 522
			 * @desc Base CREATE request primitive for AEAnnc resource
			 * @param p_accessControlPolicyIds
			 * @param p_to
			 * @param p_from
			 * @param p_appId
			 * @param p_stemId
523
			 */
524
			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:= {
525 526 527 528
				to_ := p_to,
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
				requestIdentifier := testcasename() & "-m_createAEAnnc" & f_rnd(1, 1000000),
				resourceType := int10002,
529
				primitiveContent := {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, valueof(p_to) & "/" & p_stemId)}
530 531
			};
			
532
			/**
533
			 * @desc Reception template for CREATE AEAnnc
534
			 */
535
			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 := {
536
				resourceType := int10002,
537
				primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
538
			};
539

540
			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 := {
541
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
542
				requestIdentifier := testcasename() & "-m_createAe" & f_rnd(1, 1000000),
543
				resourceType := int2,
544
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds,p_resourceName, p_appId, p_poaList)}
545
			};
546
        	
547 548 549 550 551
			/**
			 * @desc Reception template for AE registration
			 */
			template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int2,
552
				primitiveContent := {aE := ?}
553 554
			};  
			        	
555
        	template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := {
556
        		from_ := PX_AE1_ID_STEM,//TODO We should use omit, "s", or "c"
557
        		requestIdentifier := testcasename() & "-m_createAe" & f_rnd(1, 1000000),
558
        		resourceType := int2,
559
        		primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds, c_aeAuxName, -, p_poaList)}
560
			};
561
        	
562 563 564
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource
			 */
565
			template (value) RequestPrimitive m_createAcpBase modifies m_create := {
566
				requestIdentifier := testcasename() & "-m_createAcp" & f_rnd(1, 1000000),
567
				resourceType := int1,
568
				primitiveContent := {accessControlPolicy := m_contentCreateAcp ()}
569 570
			};
				
571
        	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 := {
572
        		to_ := p_parentResourceAddress,
573
        		requestIdentifier := testcasename() & "-m_createAcp" & f_rnd(1, 1000000),
574
        		resourceType := int1,
575
        		primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)}
576 577
        	};
        	
578 579 580 581 582 583 584
			/**
			 * @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,
585
				primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnnc(-)}
586 587
			};
        	
588 589 590 591
       	
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
			 */
592
        	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 := {
593
        		requestIdentifier := testcasename() & "-m_createAcpAux" & f_rnd(1, 1000000),
594
        		resourceType := int1,
595
        		primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}
596 597
        	};
        	
598
			/*template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
599
				from_ := PX_SUPER_USER,
600
				requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000),
601
				resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all
602
				primitiveContent := {cSEBase := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}
603 604 605 606 607 608
			};*/
			
			/**
			 * @desc Base CREATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := {
609
				requestIdentifier := testcasename() & "-m_createCSEBase" & f_rnd(1, 1000000),
610
				resourceType := int5,
611
				primitiveContent := {cSEBase := m_contentCreateCSEBase}
612 613
			};
        	
614 615 616 617
       	
			/**
			 * @desc Base CREATE request primitive for Container resource
			 */
618
			template (value) RequestPrimitive m_createContainerBase modifies m_create := {
619
				requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000),
620
				resourceType := int3,
621
				primitiveContent := {container := m_contentCreateContainer}
622
			};
623
			
624 625 626
			/**
			 * @desc Base CREATE request primitive for remoteCSE resource
			 */
627
			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 := {
628 629
				requestIdentifier := testcasename() & "-m_createRemoteCSE" & f_rnd(1, 1000000),
				resourceType := int16,
630
				primitiveContent := {remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
631 632
			};
			
633 634 635 636
			/**
			 * @desc CREATE request primitive for Container resource wiht no resourceName provided
			 */
			template (value) RequestPrimitive m_createContainer_noResourceName modifies m_createContainerBase := {
637
				primitiveContent := {container := m_contentCreateContainer(omit)}
638
			};
639
	
640
    		template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultContainerResourceName) modifies m_create := {
641
    			to_ := p_parentResourceAddress,
642
    			requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000),
643
    			resourceType := int3,
644
    			primitiveContent := {container := m_contentCreateContainer(p_resourceName)}
645 646
    		};
        	
647 648 649 650 651
			/**
			 * @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,
652
				primitiveContent := {container := ?}
653 654
			};  
			
655
			/**
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
656
			 * @desc Base Reception template for CREATE ContainerAnnc
657
			 */
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
658
			template RequestPrimitive mw_createContainerAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
659
				resourceType := int10003,
660
				primitiveContent := {containerAnnc := mw_contentCreateContainerAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
661
			};
662
			
663 664 665 666 667
			/**
			 * @desc Reception template for CREATE FlexContainer
			 */
			template RequestPrimitive mw_createFlexContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int28, 
668
				primitiveContent := {flexContainer := ?}
669 670 671 672 673 674 675
			};  
			
			/**
			 * @desc Reception template for CREATE GenericInterworkingOperationInstance
			 */
			template RequestPrimitive mw_createGenericIwkOpInstance(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int28,  // FIXME: not found in TS004
676
				primitiveContent := {genericInterworkingOperationInstance := ?}
677 678
			}; 
        	
679 680 681 682 683
			/**
			 * @desc Base CREATE request primitive for Content Instance resource
			 */
			template (value) RequestPrimitive m_createContentInstanceBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createContentInstance" & f_rnd(1, 1000000),
684
				resourceType := int4,
685
				primitiveContent := {contentInstance := m_contentCreateContentInstance}
686
			};
687 688 689 690 691
				
			/**
			 * @desc CREATE request primitive for Content Instance resource with no resourceName provided
			 */
			template (value) RequestPrimitive m_createContentInstance_noResourceName modifies m_createContentInstanceBase := {
692
				primitiveContent := {contentInstance := m_contentCreateContentInstance(omit)}
693
			};
694
    		
695
    		template (value) RequestPrimitive m_createContentInstance(XSD.ID p_parentResourceAddress, XSD.String p_primitiveContent) modifies m_create := {
696
    			to_ := p_parentResourceAddress,
697
    			from_ := "admin:admin",
698
    			requestIdentifier := testcasename() & "-m_createContentInstance" & f_rnd(1, 1000000),
699
    			resourceType := int4,
700
    			primitiveContent := {contentInstance := m_contentCreateContentInstance(-, p_primitiveContent)}
701 702
    		};
    		
703 704 705 706 707
			/**
			 * @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,
708
				primitiveContent := {contentInstanceAnnc := ?}
709
			};  
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
710 711 712 713 714 715
			
			/**
			 * @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,
716
				primitiveContent := {contentInstanceAnnc := mw_contentCreateContentInstanceAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
717
			};  
718 719 720 721 722 723 724 725 726
			
			/**
			 * @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()}
			};*/
727
        	    		
728 729 730 731
       	
			/**
			 * @desc Base CREATE request primitive for Group resource
			 */
732
			template (value) RequestPrimitive m_createGroupBase modifies m_create := {
733
				requestIdentifier := testcasename() & "-m_createGroup" & f_rnd(1, 1000000),
734
				resourceType := int9,
735
				primitiveContent := {group_ := m_contentCreateGroup (1, {"NotInitialized"}, omit, omit)}	//TODO: p_resourceId
736
			};
737
        	
738
        	template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
739
															in template (value) ListOfURIs p_memberIds := {"NotInitialized"},
740
															in template (omit) AcpType p_accessControlPolicyIds,
741 742 743 744
															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 := {
745
        		requestIdentifier := testcasename() & "-m_createGroup" & f_rnd(1, 1000000),
746
        		resourceType := int9,
747
        		primitiveContent := {group_ := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIds, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)}	//TODO: p_resourceId
748 749
        	};
        	
750 751 752 753 754
			/**
			 * @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,
755
				primitiveContent := {groupAnnc := ?}
756
			};  
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
757 758 759 760 761 762
			
			/**
			 * @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,
763
				primitiveContent := {groupAnnc := mw_contentCreateGroupAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
764
			};
765
        	
766
			/**
767 768 769 770 771
			 * @desc Base CREATE request primitive for MgmtCmd resource
			 */
			template (value) RequestPrimitive m_createMgmtCmdBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createMgmtCmd" & f_rnd(1, 1000000),
				resourceType := int12,
772
				primitiveContent := {mgmtResource := m_contentCreateMgmtCmd (-,-)}
773 774
			};
			
775 776 777 778 779 780
			/**
			 * @desc Base CREATE request primitive for MgmtObj resource
			 */
			template (value) RequestPrimitive m_createMgmtObjBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createMgmtObj" & f_rnd(1, 1000000),
				resourceType := int13,
781
				primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-,-)}
782 783 784 785 786 787 788 789
			};
        	
			/**
			 * @desc CREATE request primitive for MgmtObj resource
			 */
			template (value) RequestPrimitive m_createMgmtObj modifies m_create := {
				requestIdentifier := testcasename() & "-m_createMgmtObj" & f_rnd(1, 1000000),
				resourceType := int13,
790
				primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-, -)}
791 792 793 794 795 796 797
			};
        	
			/**
			 * @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,
798
				primitiveContent := {announcedMgmtResource := ?}
799 800
			};  
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
801 802 803 804 805
			/**
			 * @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,
806
				primitiveContent := {announcedMgmtResource := mw_contentCreateMgmtObjAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
807 808
			};  
			
809 810 811 812 813 814
			/**
			 * @desc Base CREATE request primitive for Node resource
			 */
			template (value) RequestPrimitive m_createNodeBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createNode" & f_rnd(1, 1000000),
				resourceType := int14,
815
				primitiveContent := {node := m_contentCreateNode(-, -, -) }
816 817 818 819 820 821 822 823
			};
        	
			/**
			 * @desc CREATE request primitive for Node resource
			 */
			template (value) RequestPrimitive m_createNode modifies m_create := {
				requestIdentifier := testcasename() & "-m_createNode" & f_rnd(1, 1000000),
				resourceType := int14,
824
				primitiveContent := {node := m_contentCreateNode(-,-,-) }
825 826 827 828 829 830 831
			};
        	
			/**
			 * @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,
832
				primitiveContent := {nodeAnnc := ?}
833
			};  
834 835 836 837
       	
			/**
			 * @desc Base CREATE request primitive for PollingChannel resource
			 */
838
			template (value) RequestPrimitive m_createPollingChannelBase modifies m_create := {
839
				requestIdentifier := testcasename() & "-m_createPollingChannel" & f_rnd(1, 1000000),
840
				resourceType := int15,
841
				primitiveContent := {pollingChannel := m_contentCreatePollingChannel (-)}
842
			};
843
        	
844
        	template (value) RequestPrimitive m_createPollingChannel(XSD.ID p_parentResourceAddress, in template (value)XSD.ID p_originatorId) modifies m_create := {
845
        		to_ := p_parentResourceAddress,
846
        		from_ := p_originatorId,
847
        		requestIdentifier := testcasename() & "-m_createPollingChannel" & f_rnd(1, 1000000),
848
        		resourceType := int15,
849
        		primitiveContent := {pollingChannel := m_contentCreatePollingChannel ()}
850 851
        	};
        	
852 853 854
			/**
			 * @desc Base CREATE request primitive for Schedule resource
			 */
855
        	template (value) RequestPrimitive m_createScheduleBase modifies m_create := {
856
        		requestIdentifier := testcasename() & "-m_createSchedule" & f_rnd(1, 1000000),
857
        		resourceType := int18,
858
        		primitiveContent := {schedule := m_contentCreateSchedule ({{"0 0 0,1,2 1 1 * *"}})}
859 860
        	};
        	
861
        	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 := {
862
        		to_ := p_parentResourceAddress,
863
        		requestIdentifier := testcasename() & "-m_createSchedule" & f_rnd(1, 1000000),
864
        		resourceType := int18,
865
        		primitiveContent := {schedule := m_contentCreateSchedule (p_scheduleElement, p_name)}
866 867
        	};
        	
868 869 870 871 872
			/**
			 * @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,
873
				primitiveContent := {scheduleAnnc := ?}
874
			};  
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
875 876 877 878 879 880
			
			/**
			 * @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,
881
				primitiveContent := {scheduleAnnc := mw_contentCreateScheduleAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
882
			};  
883
        	
884
			template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) modifies m_create := {
885
				requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRule" & f_rnd(1, 1000000),
886
				resourceType := int19,//FIXME Is this the correct value?
887
				primitiveContent := {serv