OneM2M_Templates.ttcn 100 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://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $
10
 *              $Id: OneM2M_Templates.ttcn 287 2017-05-19 06:59:12Z reinaortega $
11 12 13 14 15 16 17 18 19 20 21
 *  @desc       Module containing templates for oneM2M
 *
 */
module OneM2M_Templates {

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

24
		
25 26 27 28 29 30
	/**
	 * @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 
31
	 */
32 33 34 35 36
	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);	
	}

37 38

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

99 100 101 102
			/**
			 * @desc Base RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
103
			 */
104
			template (value) RequestPrimitive m_retrieveResource(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
105
				operation := int2,
106
				to_ := p_targetResourceAddress,
107
				from_ := p_originator,
108 109
				requestIdentifier := "m_retrieveResource" & f_rnd(1, 1000000),
				resourceType := omit,
110
				primitiveContent := omit,
111
				roleIDs := omit, 
112 113 114 115 116 117 118 119 120 121 122
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
123 124 125
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
126
				localTokenIDs := omit,
127
				tokenRequestIndicator := omit
128 129
			};
        	
130 131 132 133 134
			/**
			 * @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)
			 */
135
        	template (value) RequestPrimitive m_retrieveResourceAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
136
        		operation := int2,
137
        		to_ := p_targetResourceAddress,
138
        		from_ := p_originator,
139 140
        		requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
        		resourceType := omit,
141
				primitiveContent := omit, 
142
				roleIDs := omit,
143 144 145 146 147 148 149 150 151 152 153
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
154 155 156
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
157
				localTokenIDs := omit,
158
				tokenRequestIndicator := omit
159 160
        	};
        	
161 162 163 164 165
			/**
			 * @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)
166
			 */
167
			template (value) RequestPrimitive m_retrieveResourceAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
168
				operation := int2,
169
				to_ := p_targetResourceAddress,
170
				from_ := p_originator,
171 172
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
173 174
				primitiveContent := {
					any_1 := {{AttributeList := p_attributeList}}
175
				},
176
				roleIDs := omit,
177 178 179 180 181 182 183 184 185 186 187
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
188 189 190
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
191
				localTokenIDs := omit,
192
				tokenRequestIndicator := omit
193 194 195 196
			};
    	}//end group Retrieve

    	group Update {
197 198
    		
    		template (value) RequestPrimitive m_update := {
199 200
				operation := int3,
				to_ := "NotInitialized",
201 202
				from_ := "NotInitialized",
				requestIdentifier := "m_update" & f_rnd(1, 1000000),
203
				resourceType := omit,
204
				primitiveContent:= omit,
205
				roleIDs := omit, 
206 207 208 209 210 211 212 213 214 215 216
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
217 218 219
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
220
				localTokenIDs := omit,
221
				tokenRequestIndicator := omit
222
			};
223
        	
224 225 226 227 228 229 230 231 232 233
			/**
			 * @desc Base UPDATE request primitive for Ae resource
			 */
			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
				requestIdentifier := "m_updateAe" & f_rnd(1, 1000000),
				primitiveContent:= {
							any_1 := {{AE_optional := m_contentUpdateAe}}
				}
			};
        	
234 235 236 237 238 239 240 241 242
			/**
			 * @desc Base UPDATE request primitive for Container resource
			 */
			template (value) RequestPrimitive m_updateContainerBase modifies m_update:= {
				requestIdentifier := "m_updateContainer" & f_rnd(1, 1000000),
				primitiveContent:= {
							any_1 := {{Container_optional := m_contentUpdateContainer}}
				}
			};
243
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
244 245 246 247 248 249 250 251 252 253 254
			//@ACV
			/**
			 * @desc Base UPDATE request primitive for ContentInstance resource
			 */
			template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= {
				requestIdentifier := "m_updateContentInstance" & f_rnd(1, 1000000),
				primitiveContent:= {
							any_1 := {{ContentInstance_optional := m_contentUpdateContentInstance}}
				}
			};
			
255 256 257
			/**
			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
			 */        				
258
			template (value) RequestPrimitive m_updateAcpBase modifies m_update := {
259
				requestIdentifier := "m_updateAcp" & f_rnd(1, 1000000),
260
				primitiveContent:= {
261
							any_1 := {{AccessControlPolicy_optional := m_contentUpdateAcp}}
262
				}
263 264
			};
			
265 266 267 268 269 270 271
			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),
				primitiveContent:= {
							any_1 := {{AccessControlPolicy_optional := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}}
				}
			};
			
272 273 274
			/**
			 * @desc Base UPDATE request primitive for Group resource
			 */
275
			template (value) RequestPrimitive m_updateGroupBase modifies m_update := {
276
				requestIdentifier := "m_updateGroup" & f_rnd(1, 1000000),
277
				primitiveContent:= {
278
							any_1 := {{Group_optional := m_contentUpdateGroup}}
279
				}
280 281
			};
			
282 283 284
			/**
			 * @desc Base UPDATE request primitive for Schedule resource
			 */
285
			template (value) RequestPrimitive m_updateScheduleBase modifies m_update := {
286
				requestIdentifier := "m_updateSchedule" & f_rnd(1, 1000000),
287
				primitiveContent:= {
288
							any_1 := {{Schedule_optional := m_contentUpdateSchedule}}
289
				}
290 291
			};
			
292 293 294
			/**
			 * @desc Base UPDATE request primitive for PollingChannel resource
			 */
295
			template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := {
296
				requestIdentifier := "m_updatePollingChannel" & f_rnd(1, 1000000),
297
				primitiveContent:= {
298
							any_1 := {{PollingChannel_optional := m_contentUpdatePollingChannel}}
299
				}
300 301
			};
			
302 303 304
			/**
			 * @desc Base UPDATE request primitive for Subscription resource
			 */
305
			template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := {
306
				requestIdentifier := "m_updateSubscription" & f_rnd(1, 1000000),
307
				primitiveContent:= {
308
							any_1 := {{Subscription_optional := m_contentUpdateSubscription}}
309
				}
310
			};
311 312
			
			//@Martin
313
        	template (value) RequestPrimitive m_updateLocationPolicy(XSD.ID p_locResourceAddress, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.Duration p_locationUpdatePeriod) modifies m_update := {
oneM2MTester Develop Team's avatar
oneM2MTester Develop Team committed
314
        	  	to_ 				:= p_locResourceAddress,
315 316
        	  	requestIdentifier	:= "m_updateLocationPolicy",
        	  	primitiveContent	:= {        	    
317
        	    			any_1 := {{ LocationPolicy_optional := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod) }}
318 319
        		}
			  };
320
        	
321 322 323
    	}//end group Update
    	
    	group Create {
324 325 326 327 328

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
329
				requestIdentifier := testcasename() & "-m_create" & f_rnd(1, 1000000),
330 331
				resourceType := omit,
				primitiveContent := omit,
332
				roleIDs := omit,
333 334 335 336 337 338 339 340 341 342 343 344 345 346
				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,
347
				localTokenIDs := omit,
348
				tokenRequestIndicator := omit
349 350

			};
351
        	
352 353 354 355 356
			/**
			 * @desc Base Reception template for create operation
			 */
			template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int1,
357
				to_ := p_to,
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
				primitiveContent := {
					any_1 := ?	
				},
				roleIDs := *,
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *,
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
				tokenRequestIndicator := *
			}
			
383 384
			
			/**
385 386 387 388 389 390
			 * @desc Base CREATE request primitive for AEAnnc resource
			 * @param p_accessControlPolicyIds
			 * @param p_to
			 * @param p_from
			 * @param p_appId
			 * @param p_stemId
391
			 */
392
			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:= {
393 394 395 396 397
				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,
				primitiveContent := {
398
					any_1 := {{AEAnnc_optional := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, valueof(p_to) & "/" & p_stemId)}}	
399
				}
400 401
			};
			
402
			/**
403
			 * @desc Reception template for CREATE AEAnnc
404
			 */
405
			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 := {
406 407
				resourceType := int10002,
				primitiveContent := {
408 409
					any_1 := {{AEAnnc_optional := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}}	
				}
410
			};
411 412

			//Added by @Naum
413
			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 := {
414
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
415
				requestIdentifier := testcasename() & "-m_createAe" & f_rnd(1, 1000000),
416 417
				resourceType := int2,
				primitiveContent := {
418
					any_1 := {{AE_optional := m_contentCreateAe(p_accessControlPolicyIds,p_resourceName, p_appId, p_poaList)}}	
419
				}
420
			};
421
        	
422 423 424 425 426 427 428 429 430 431
			/**
			 * @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,
				primitiveContent := {
					any_1 := {{AE_optional := ?}}	
				}
			};  
			        	
432
        	template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := {
433
        		from_ := PX_AE1_ID_STEM,//TODO We should use omit, "s", or "c"//@Martin
434
        		requestIdentifier := testcasename() & "-m_createAe" & f_rnd(1, 1000000),
435
        		resourceType := int2,
436
        		primitiveContent := {
437
        			any_1 := {{AE_optional := m_contentCreateAe(p_accessControlPolicyIds, c_aeAuxName, -, p_poaList)}}	
438 439
        		}
			};
440
        	
441 442 443
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource
			 */
444
			template (value) RequestPrimitive m_createAcpBase modifies m_create := {
445
				requestIdentifier := testcasename() & "-m_createAcp" & f_rnd(1, 1000000),
446
				resourceType := int1,
447
				primitiveContent := {
448
					any_1 := {{AccessControlPolicy_optional := m_contentCreateAcp ()}}
449
				}
450 451
			};
				
452
        	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 := {
453
        		to_ := p_parentResourceAddress,
454
        		from_ := PX_SUPER_USER,
455
        		requestIdentifier := testcasename() & "-m_createAcp" & f_rnd(1, 1000000),
456
        		resourceType := int1,
457
        		primitiveContent := {
458
					any_1 := {{AccessControlPolicy_optional := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)}}
459
        		}
460 461
        	};
        	
462 463 464 465 466 467 468 469 470 471 472 473
			/**
			 * @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 := {
					any_1 := {{AccessControlPolicyAnnc_optional := mw_contentCreateAcpAnnc(-)}}	
				}
			};
        	
474 475 476 477
       	
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
			 */
478
        	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 := {
479
        		from_ := PX_SUPER_USER,
480
        		requestIdentifier := testcasename() & "-m_createAcpAux" & f_rnd(1, 1000000),
481
        		resourceType := int1,
482
        		primitiveContent := {
483
        			any_1 := {{AccessControlPolicy_optional := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}}	
484
        		}
485 486
        	};
        	
487
			//Added by @Naum
488
			template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
489
				from_ := PX_SUPER_USER,
490
				requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000),
491
				resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all
492 493
				primitiveContent := {
					any_1 := {{CSEBase_optional := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}}
494
				}
495 496
			};
        	
497 498 499 500
       	
			/**
			 * @desc Base CREATE request primitive for Container resource
			 */
501
			template (value) RequestPrimitive m_createContainerBase modifies m_create := {
502
				requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000),
503
				resourceType := int3,
504 505
				primitiveContent := {
					
506
					any_1 := {{Container_optional := m_contentCreateContainer}}
507
				}
508
			};
509 510 511 512 513 514 515 516 517
			
			/**
			 * @desc CREATE request primitive for Container resource wiht no resourceName provided
			 */
			template (value) RequestPrimitive m_createContainer_noResourceName modifies m_createContainerBase := {
				primitiveContent := {
					any_1 := {{Container_optional := m_contentCreateContainer(omit)}}
				}
			};
518
	
519
    		template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultContainerResourceName) modifies m_create := {
520
    			to_ := p_parentResourceAddress,
521
    			requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000),
522
    			resourceType := int3,
523
    			primitiveContent := {
524
    				any_1 := {{Container_optional := m_contentCreateContainer(p_resourceName)}}
525
    			}
526 527
    		};
        	
528 529 530 531 532 533 534 535 536 537
			/**
			 * @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 := {
					any_1 := {{Container_optional := ?}}	
				}
			};  
			
538
			/**
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
539
			 * @desc Base Reception template for CREATE ContainerAnnc
540
			 */
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
541
			template RequestPrimitive mw_createContainerAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
542 543
				resourceType := int10003,
				primitiveContent := {
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
544
					any_1 := {{ContainerAnnc_optional := mw_contentCreateContainerAnncBase}}	
545
				}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
546
			};
547
			
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
			/**
			 * @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, 
				primitiveContent := {
					any_1 := {{FlexContainer_optional := ?}}	
				}
			};  
			
			/**
			 * @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
				primitiveContent := {
					any_1 := {{GenericInterworkingOperationInstance_optional := ?}}	
				}
			}; 
        	
568 569 570 571 572
			/**
			 * @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),
573
				resourceType := int4,
574 575 576 577 578
				primitiveContent := {
			
					any_1 := {{ContentInstance_optional := m_contentCreateContentInstance}}
				}
			};
579 580 581 582 583 584 585 586 587 588
				
			/**
			 * @desc CREATE request primitive for Content Instance resource with no resourceName provided
			 */
			template (value) RequestPrimitive m_createContentInstance_noResourceName modifies m_createContentInstanceBase := {
				primitiveContent := {
			
					any_1 := {{ContentInstance_optional := m_contentCreateContentInstance(omit)}}
				}
			};
589
    		
590
    		template (value) RequestPrimitive m_createContentInstance(XSD.ID p_parentResourceAddress, XSD.String p_primitiveContent) modifies m_create := {
591
    			to_ := p_parentResourceAddress,
592
    			from_ := "admin:admin",
593
    			requestIdentifier := testcasename() & "-m_createContentInstance" & f_rnd(1, 1000000),
594
    			resourceType := int4,
595
    			primitiveContent := {
596
    				any_1 := {{ContentInstance_optional := m_contentCreateContentInstance(p_primitiveContent)}}	
597
    			}
598 599
    		};
    		
600 601 602 603 604 605 606 607 608
			/**
			 * @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 := {
					any_1 := {{ContentInstanceAnnc_optional := ?}}	
				}
			};  
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
609 610 611 612 613 614 615
			
			/**
			 * @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 := {
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
616
					any_1 := {{ContentInstanceAnnc_optional := mw_contentCreateContentInstanceAnncBase}}	
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
617 618
				}
			};  
619
        	    		
620 621 622 623
       	
			/**
			 * @desc Base CREATE request primitive for Group resource
			 */
624
			template (value) RequestPrimitive m_createGroupBase modifies m_create := {
625
				requestIdentifier := testcasename() & "-m_createGroup" & f_rnd(1, 1000000),
626 627
				resourceType := int9,
				primitiveContent := {
628
					any_1 := {{Group_optional := m_contentCreateGroup (1, {"NotInitialized"}, omit, omit)}}	//TODO: p_resourceId
629 630
				}
			};
631
        	
632
        	template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
633
															in template (value) ListOfURIs p_memberIds := {"NotInitialized"},
634
															in template (omit) AcpType p_accessControlPolicyIds,
635 636 637 638
															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 := {
639
        		requestIdentifier := testcasename() & "-m_createGroup" & f_rnd(1, 1000000),
640
        		resourceType := int9,
641
        		primitiveContent := {
642
        			any_1 := {{Group_optional := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIds, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)}}	//TODO: p_resourceId
643
        		}
644 645
        	};
        	
646 647 648 649 650 651 652 653 654
			/**
			 * @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 := {
					any_1 := {{GroupAnnc_optional := ?}}	
				}
			};  
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
655 656 657 658 659 660 661
			
			/**
			 * @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 := {
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
662
					any_1 := {{GroupAnnc_optional := mw_contentCreateGroupAnncBase}}	
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
663 664
				}
			};
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697
        	
			/**
			 * @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,
				primitiveContent := {
					any_1 := {{MgmtObj_optional := m_contentCreateMgmtObj (-,-)}}	
				}
			};
        	
			/**
			 * @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,
				primitiveContent := {
					any_1 := {{MgmtObj_optional := 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 := {
					any_1 := {{MgmtObjAnnc_optional := ?}}	
				}
			};  
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
698 699 700 701 702 703
			/**
			 * @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 := {
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
704
					any_1 := {{MgmtObjAnnc_optional := mw_contentCreateMgmtObjAnncBase}}	
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
705 706 707
				}
			};  
			
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738
			/**
			 * @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,
				primitiveContent := {
					any_1 := {{Node_optional := m_contentCreateNode(-, -, -) }}	
				}
			};
        	
			/**
			 * @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,
				primitiveContent := {
					any_1 := {{Node_optional := m_contentCreateNode(-,-,-) }}
				}
			};
        	
			/**
			 * @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 := {
					any_1 := {{NodeAnnc_optional := ?}}	
				}
			};  
739 740 741 742
       	
			/**
			 * @desc Base CREATE request primitive for PollingChannel resource
			 */
743
			template (value) RequestPrimitive m_createPollingChannelBase modifies m_create := {
744
				requestIdentifier := testcasename() & "-m_createPollingChannel" & f_rnd(1, 1000000),
745 746
				resourceType := int15,
				primitiveContent := {
747
					any_1 := {{PollingChannel_optional := m_contentCreatePollingChannel (-)}}	
748 749
				}
			};
750
        	
751
        	template (value) RequestPrimitive m_createPollingChannel(XSD.ID p_parentResourceAddress, in template (value)XSD.ID p_originatorId) modifies m_create := {
752
        		to_ := p_parentResourceAddress,
753
        		from_ := p_originatorId,
754
        		requestIdentifier := testcasename() & "-m_createPollingChannel" & f_rnd(1, 1000000),
755
        		resourceType := int15,
756
        		primitiveContent := {
757
        			any_1 := {{PollingChannel_optional := m_contentCreatePollingChannel ()}}	
758
        		}
759 760
        	};
        	
761 762 763
			/**
			 * @desc Base CREATE request primitive for Schedule resource
			 */
764
        	template (value) RequestPrimitive m_createScheduleBase modifies m_create := {
765
        		requestIdentifier := testcasename() & "-m_createSchedule" & f_rnd(1, 1000000),
766
        		resourceType := int18,
767
        		primitiveContent := {
768
        			any_1 := {{Schedule_optional := m_contentCreateSchedule ({{"0 0 0,1,2 1 1 * *"}})}}	
769
        		}
770 771
        	};
        	
772
        	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 := {
773
        		to_ := p_parentResourceAddress,
774
        		requestIdentifier := testcasename() & "-m_createSchedule" & f_rnd(1, 1000000),
775
        		resourceType := int18,
776
        		primitiveContent := {
777
        			any_1 := {{Schedule_optional := m_contentCreateSchedule (p_scheduleElement, p_name)}}	
778
        		}
779 780
        	};
        	
781 782 783 784 785 786 787 788 789
			/**
			 * @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 := {
					any_1 := {{ScheduleAnnc_optional := ?}}	
				}
			};  
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
790 791 792 793 794 795 796
			
			/**
			 * @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 := {
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
797
					any_1 := {{ScheduleAnnc_optional := mw_contentCreateScheduleAnncBase}}	
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
798 799
				}
			};  
800
        	
801
			template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) modifies m_create := {
802
				requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRule" & f_rnd(1, 1000000),
803
				resourceType := int19,//FIXME Is this the correct value?
804
				primitiveContent := {
805
					any_1 := {{ServiceSubscribedAppRule_optional := m_contentCreateServiceSubscribedAppRule (p_applicableCredIDs, p_allowedAppIDs, p_allowedAEs)}}
806
				}
807
			};
808
        	
809 810 811 812
       	
			/**
			 * @desc Base CREATE request primitive for Subscription resource
			 */
813
			template (value) RequestPrimitive m_createSubscriptionBase modifies m_create := {
814
				requestIdentifier := testcasename() & "-m_createSubscription" & f_rnd(1, 1000000),
815
				resourceType := int23,
816
				primitiveContent := {
817
					any_1 := {{Subscription_optional := m_contentCreateSubscription ({"NotInitialized"})}}	
818
				}
819 820
			};
        	
821
        	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 := {
822
        		to_ := p_parentResourceAddress,
823
        		requestIdentifier := testcasename() & "-m_createSubscription" & f_rnd(1, 1000000),
824
        		resourceType := int23,
825
        		primitiveContent := {
826
					any_1 := {{Subscription_optional := m_contentCreateSubscription (p_notificationURI, p_name)}}	
827
        		}
828
        	};
829
        	
830 831 832 833 834 835 836 837 838 839 840 841 842 843
			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,
																		   in template (omit) NotificationContentType p_notificationContentType := int1) modifies m_createSubscription := {
				primitiveContent := {
					any_1 := {{Subscription_optional := m_contentCreateSubscriptionAdvanced (p_notificationURI, p_name, p_eventNotificationCriteria, p_expirationCounter, p_batchNotify, p_latestNotify, p_subscriberURI, p_notificationContentType)}}	
				}
			};
        	
844
        	//@Martin
845 846
        	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 := {
        		
847
        	  	requestIdentifier	:= testcasename() & "-m_createLocationPolicy" & f_rnd(1, 1000000), //the requestIdentifier is supposed to be set similar as "C190XX7T/001"  by prepending the AE-ID-Stem and slash(‘/’) in front of it
848 849
        	  	resourceType		:= int10,
        	  	primitiveContent	:= {        	    
850
        	    			any_1 := {{ LocationPolicy_optional := m_contentCreateLocationPolicy(p_locationSource, p_accessControlPolicyIds, p_locationUpdatePeriod, p_locationTargetID, p_locationServerAddress) }}
851 852
        	  	},
			  	resultContent := int1//default
853
        	};
854 855 856 857 858 859 860 861 862
        	
			/**
			 * @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 := {
					any_1 := {{LocationPolicyAnnc_optional := ?}}	
				}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
863 864 865 866 867 868 869 870
			}; 
			
			/**
			 * @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 := {
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
871
					any_1 := {{LocationPolicyAnnc_optional := mw_contentCreateLocationPolicyAnncBase}}	
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
872 873 874
				}
			}; 
			
875
        	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 := {
876
        	  requestIdentifier	:= testcasename() & "-m_createNotification" & f_rnd(1, 1000000),
877
        	  primitiveContent	:= {	
878
        	    			any_1 :=	{{ Notification := m_contentCreateNotification(p_resourcePresentation, p_notifEventType, p_subscriptionReference, p_notifForwardingURI)}}        	    
879 880 881 882
        	  },
        	  resultContent		:= int1 //default
        	  
        	};
883
        	
884 885 886 887 888 889 890 891 892 893
			/**
			 * @desc Reception template for SemanticDescriptor creation
			 */
			template RequestPrimitive mw_createSemanticDescriptor(template XSD.ID p_from := *, template XSD.ID p_to := ?, template SemanticDescriptor_optional p_semanticDescriptor := mw_contentCreateSemanticDescriptor) modifies mw_create := {
				resourceType := int24,
				primitiveContent := {
					any_1 := {{SemanticDescriptor_optional := p_semanticDescriptor}}	
				}
			};
			
894 895 896 897
    	}//end group Create
    	
    	group Delete {
    	
898
        	template (value) RequestPrimitive m_deleteRequest(XSD.ID p_resourceAddress, in XSD.ID p_originator := PX_SUPER_USER) := {
899
        		operation := int4,
900
        		to_ := p_resourceAddress,
901
        		from_ := p_originator,
902
        		requestIdentifier := testcasename() & "-m_dele