OneM2M_Templates.ttcn 193 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
 *  @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_Pixits all;
20
    import from OneM2M_Functions all;
21

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

35 36

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

98 99 100 101
			/**
			 * @desc Base RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
102
			 */
103
			template (value) RequestPrimitive m_retrieve(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
104
				operation := int2,
105
				to_ := p_targetResourceAddress,
106
				from_ := p_originator,
107
				requestIdentifier := "m_retrieve" & f_rnd(1, 1000000),
108
				resourceType := omit,
109
				primitiveContent := omit,
110
				roleIDs := omit, 
111 112 113 114 115 116 117 118 119 120 121
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
122 123 124
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
125
				localTokenIDs := omit,
126 127 128
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
129 130
			};
        	
131 132 133 134 135
			/**
			 * @desc RETRIEVE request primitive for child references
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
			 */
136
			template (value) RequestPrimitive m_retrieveChildResourceRefs(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, template (omit) ResourceTypeList p_resourceTypeList := omit) modifies m_retrieve := {
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
				filterCriteria := {
					createdBefore := omit,
					createdAfter := omit,
					modifiedSince := omit,
					unmodifiedSince := omit,
					stateTagSmaller := omit,
					stateTagBigger := omit,
					expireBefore := omit,
					expireAfter := omit,
					labels := omit,
					resourceType := p_resourceTypeList,
					sizeAbove := omit,
					sizeBelow := omit,
					contentType_list := {},
					attribute_list := {},
152
					filterUsage := int1,
153 154 155 156 157 158 159
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
160 161 162
				}
			};
			
163 164 165 166
			/**
			 * @desc Base Receive RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 */
167
			template RequestPrimitive mw_retrieve(template XSD.ID p_targetResourceAddress) := {
168 169 170 171
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := ?,
				requestIdentifier := ?,
172
				resourceType := omit,
173
				primitiveContent := *,
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
				roleIDs := *, 
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *,
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
190 191 192
				tokenRequestIndicator := *,
				releaseVersionIndicator := ?,
				vendorInformation := *
193 194
			};
        	
195 196 197 198 199
			/**
			 * @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)
			 */
200
			template (value) RequestPrimitive m_retrieveAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
201
        		operation := int2,
202
        		to_ := p_targetResourceAddress,
203
        		from_ := p_originator,
204 205
        		requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
        		resourceType := omit,
206
				primitiveContent := omit, 
207
				roleIDs := omit,
208 209 210 211 212 213 214 215 216 217 218
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
219 220 221
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
222
				localTokenIDs := omit,
223 224 225
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
226 227
        	};
        	
228 229 230 231 232
			/**
			 * @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)
233
			 */
234
			template (value) RequestPrimitive m_retrieveAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
235
				operation := int2,
236
				to_ := p_targetResourceAddress,
237
				from_ := p_originator,
238 239
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
240
				primitiveContent := {attributeList := p_attributeList},
241
				roleIDs := omit,
242 243 244 245 246 247 248 249 250 251 252
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
253 254 255
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
256
				localTokenIDs := omit,
257 258 259
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
260
			};
261 262 263 264 265 266 267
			
			/**
			  * @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)
		     */
268
			template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
269 270
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
271 272 273 274 275 276 277 278 279 280 281 282 283 284
					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 := {},
285
					filterUsage := p_filterUsage,
286 287 288 289 290 291 292
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
293 294 295
				}
			};
			
296 297 298 299 300 301 302 303 304 305 306
			/**
			  * @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_retrieveFilterCriteria(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterCriteria p_filterCriteria) modifies m_retrieve := {
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := p_filterCriteria
			};
			
Pramod Kulkarni's avatar
Pramod Kulkarni committed
307 308 309 310 311 312 313
			/**
			  * @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
			 */
314
			template (value) RequestPrimitive m_retrieveFilterUsageOptionLabel(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage, in Labels p_labels) modifies m_retrieve := {
Pramod Kulkarni's avatar
Pramod Kulkarni committed
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
				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, 
332 333 334 335 336 337 338
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
Pramod Kulkarni's avatar
Pramod Kulkarni committed
339 340
				}
			};
341 342 343 344 345 346
			/**
			  * @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)
			 */
347
			template (value) RequestPrimitive m_retrieveDiscResTypeFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) DiscResType p_discResType, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
348 349
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
350 351 352 353 354 355 356 357 358 359 360 361 362 363
					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 := {},
364
					filterUsage := p_filterUsage,
365 366 367 368 369 370 371
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
372 373 374 375 376
				},
				discoveryResultType := p_discResType
			};
			
			/**
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399
			  * @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_retrieveInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieve := {
				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,
400 401 402 403 404 405 406
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
407 408
				}
			};
409
			
410 411 412 413 414 415 416 417 418 419
			/**
			  * @desc RETRIEVE request primtive for polling request
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
			template (value) RequestPrimitive m_retrievePollingRequest(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieve := {
				to_ := p_targetResourceAddress & "/pcu"
			};
			
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438
			/**
			  * @desc FilterCriteria empty template
			 */
			template (value) FilterCriteria m_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,
439 440 441 442 443 444 445 446
				limit := omit,
				semanticsFilter_list := {},
				filterOperation := omit,
				contentFilterSyntax := omit,
				contentFilterQuery := omit,
				level := omit,
				offset := omit
				
447 448 449
			}
			
			
450
			
451 452 453
    	}//end group Retrieve

    	group Update {
454 455
    		
    		template (value) RequestPrimitive m_update := {
456 457
				operation := int3,
				to_ := "NotInitialized",
458
				from_ := "NotInitialized",
459
				requestIdentifier := "m_update",
460
				resourceType := omit,
461
				primitiveContent:= omit,
462
				roleIDs := omit, 
463 464 465 466 467 468 469 470 471 472 473
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
474 475 476
				discoveryResultType := omit,
				tokens := omit,
				tokenIDs := omit,
477
				localTokenIDs := omit,
478 479 480
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
481
			};
482
        	
483 484 485 486 487 488
						
			template RequestPrimitive mw_update(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int3,
				to_ := p_to,
				from_ := p_from,
				requestIdentifier := ?,
489
				resourceType := omit,
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506
				primitiveContent:= ?,
				roleIDs := *, 
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *, 
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
507 508 509
				tokenRequestIndicator := *,
				releaseVersionIndicator := ?,
				vendorInformation := *
510 511
			};
        	
512 513 514 515
			/**
			 * @desc Base UPDATE request primitive for Ae resource
			 */
			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
516
				requestIdentifier := "m_updateAe",
517
				primitiveContent:= {aE := m_contentUpdateAe}
518 519
			};
        	
520 521 522 523 524 525 526 527 528
			/**
			 * @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 := ?}
			};
			 
        	
529 530 531 532
			/**
			 * @desc Base UPDATE request primitive for Container resource
			 */
			template (value) RequestPrimitive m_updateContainerBase modifies m_update:= {
533
				requestIdentifier := "m_updateContainer",
534
				primitiveContent:= {container := m_contentUpdateContainer}
535
			};
536
			
537 538 539 540 541 542 543
			/**
			 * @desc Base Reception template for update Container
			 */
			template RequestPrimitive mw_updateContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				primitiveContent := {container := ?}
			}; 
			
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
544 545 546 547
			/**
			 * @desc Base UPDATE request primitive for ContentInstance resource
			 */
			template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= {
548
				requestIdentifier := "m_updateContentInstance",
549
				primitiveContent:= {contentInstance := m_contentUpdateContentInstance}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
550 551
			};
			
552 553 554
			/**
			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
			 */        				
555
			template (value) RequestPrimitive m_updateAcpBase modifies m_update := {
556
				requestIdentifier := "m_updateAcp",
557
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcp}
558 559
			};
			
560
			template (value) RequestPrimitive m_updateAcpPrivileges(in template(omit) SetOfAcrs p_privileges := omit, in template(omit) SetOfAcrs p_selfPrivileges := omit) modifies m_update := {
561
				requestIdentifier := "m_updateAcp",
562
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}
563 564
			};
			
565 566 567
			/**
			 * @desc Base UPDATE request primitive for Group resource
			 */
568
			template (value) RequestPrimitive m_updateGroupBase modifies m_update := {
569
				requestIdentifier := "m_updateGroup",
570
				primitiveContent:= {group_ := m_contentUpdateGroup}
571 572
			};
			
573 574 575 576
			/**
			 * @desc Base UPDATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := {
577
				requestIdentifier := "m_updateGroup",
578
				primitiveContent:= {cSEBase := m_contentUpdateCSEBase}
579 580
			};
			
581 582 583
			/**
			 * @desc Base UPDATE request primitive for Schedule resource
			 */
584
			template (value) RequestPrimitive m_updateScheduleBase modifies m_update := {
585
				requestIdentifier := "m_updateSchedule",
586
				primitiveContent:= {schedule := m_contentUpdateSchedule}
587 588
			};
			
589 590 591
			/**
			 * @desc Base UPDATE request primitive for PollingChannel resource
			 */
592
			template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := {
593
				requestIdentifier := "m_updatePollingChannel",
594
				primitiveContent:= {pollingChannel := m_contentUpdatePollingChannel}
595 596
			};
			
597 598 599
			/**
			 * @desc Base UPDATE request primitive for Subscription resource
			 */
600
			template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := {
601
				requestIdentifier := "m_updateSubscription",
602
				primitiveContent:= {subscription := m_contentUpdateSubscription}
603
			};
604
			
605
			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
606
        	  	to_ 				:= p_locResourceAddress,
607
        	  	requestIdentifier	:= "m_updateLocationPolicy",
608
        	  	primitiveContent	:= {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)}
609
			  };
610
        	
611
        	template (value) RequestPrimitive m_updateNodeBase modifies m_update := {
612
				requestIdentifier := "m_updateNode",
613 614 615 616
				primitiveContent:= {node := m_contentUpdateNode}
        	}
        	
        	template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := {
617
			   requestIdentifier := "m_updateRemoteCSEBase",
618 619
        	   primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
        	}
620 621 622 623 624 625 626 627 628

			/**
			 * @desc Reception template for update remoteCSE resource
			 */
			template RequestPrimitive mw_updateRemoteCSE(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int16,
				primitiveContent:= {remoteCSE := ?}
			};
			       	
629
			template (value) RequestPrimitive m_updateAEAnncBase modifies m_update:= {
630
				requestIdentifier := testcasename() & "-m_updateAEAnnc",
631
				resourceType := int10002,
632
				primitiveContent := {aEAnnc := m_contentUpdateAEAnnc}
633
			};
634
			
635 636 637 638
			/**
			 * @desc Base Reception template for update ContainerAnnc
			 */
			template RequestPrimitive mw_updateContainerAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
639
				resourceType := int10003,
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656
				primitiveContent := {containerAnnc := ?}
			}; 
			
			/**
			 * @desc Base Reception template for update GroupAnnc
			 */
			template RequestPrimitive mw_updateGroupAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int10009,
				primitiveContent := {groupAnnc := ?}
			}; 
			
			/**
			 * @desc Base Reception template for update AccessControlPolicyAnnc
			 */
			template RequestPrimitive mw_updateAccessControlPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int10001,
				primitiveContent := {accessControlPolicyAnnc := ?}
657 658 659 660 661 662 663 664
			}; 	
			
			/**
			 * @desc Base UPDATE request primitive for TimeSeries resource
			 */
			template (value) RequestPrimitive m_updateTimeSeriesBase modifies m_update := {
				requestIdentifier := "m_updateTimeSeries",
				primitiveContent:= {timeSeries := m_contentUpdateTimeSeries}
665 666 667 668 669 670 671 672
			};
			
			/**
			 * @desc Base UPDATE request primitive for TimeSeriesInstance resource
			 */
			template (value) RequestPrimitive m_updateTimeSeriesInstanceBase modifies m_update:= {
				requestIdentifier := "m_updateTimeSeriesInstance",
				primitiveContent:= {timeSeriesInstance := m_contentUpdateTimeSeriesInstance}
673 674 675 676 677 678 679 680 681
			};		
			
			/**
			 * @desc Base Reception template for update TimeSeriesAnnc
			 */
			template RequestPrimitive mw_updateTimeSeriesAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				resourceType := int10029,
				primitiveContent := {timeSeriesAnnc := ?}
			}; 
682 683
			
			
684 685 686
    	}//end group Update
    	
    	group Create {
687 688 689 690 691

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
692
				requestIdentifier := testcasename() & "-m_create",
693 694
				resourceType := omit,
				primitiveContent := omit,
695
				roleIDs := omit,
696 697 698 699 700 701 702 703 704 705 706 707 708 709
				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,
710
				localTokenIDs := omit,
711 712 713
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
714 715

			};
716
        	
717 718 719 720 721
			/**
			 * @desc Base Reception template for create operation
			 */
			template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int1,
722
				to_ := p_to,
723 724 725
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
726
				primitiveContent := ?,
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742
				roleIDs := *,
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *,
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
743 744 745
				tokenRequestIndicator := *,
				releaseVersionIndicator := ?,
				vendorInformation := *
746 747
			}
			
748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773
			/**
			 * @desc Base Reception template for create operation for announced resources
			 */
			template RequestPrimitive mw_createAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?) := {
				operation := int1,
				to_ := p_to,
				from_ := p_from,
				requestIdentifier := ?,
				resourceType := ?,
				primitiveContent := ?,
				roleIDs := *,
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
				discoveryResultType := *,
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
774
				tokenRequestIndicator := *,
775 776
				releaseVersionIndicator := ?,
				vendorInformation := *
777 778
			}
			
779 780
			
			/**
781 782 783 784 785 786
			 * @desc Base CREATE request primitive for AEAnnc resource
			 * @param p_accessControlPolicyIds
			 * @param p_to
			 * @param p_from
			 * @param p_appId
			 * @param p_stemId
787
			 */
788
			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.AnyURI p_link) modifies m_create:= {
789 790
				to_ := p_to,
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
791
				requestIdentifier := testcasename() & "-m_createAEAnnc",
792
				resourceType := int10002,
793
				primitiveContent := {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, p_link)}
794 795
			};
			
796
			/**
797
			 * @desc Reception template for CREATE AEAnnc for registration when AE-ID-Stem starts with S
798
			 */
799
			template RequestPrimitive mw_createAEAnnc_s_ae_id(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := {				
800
				primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_link)}
801
			};
802

803 804 805 806 807 808 809
			/**
			 * @desc Reception template for CREATE AEAnnc as announced resource
			 */
			template RequestPrimitive mw_createAEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := {				
				primitiveContent := {aEAnnc := mw_contentCreateAEAnnc(-, p_accessControlPolicyIds)}
			};
			
810
			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 := {
811
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
812
				requestIdentifier := testcasename() & "-m_createAe",
813
				resourceType := int2,
814
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds,p_resourceName, p_appId, p_poaList)}
815
			};
816
        	
817 818 819
			/**
			 * @desc Reception template for AE registration
			 */
820
			template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?, template AE_optional p_ae := ?) modifies mw_create := {
821
				resourceType := int2,
822
				primitiveContent := {aE := p_ae}
823 824
			};  
			        	
825
        	template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := {
826
        		from_ := PX_AE1_ID_STEM,//TODO We should use omit, "s", or "c"
827
				requestIdentifier := testcasename() & "-m_createAe",
828
        		resourceType := int2,
829
        		primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds, c_aeAuxName, -, p_poaList)}
830
			};
831
        	
832 833 834
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource
			 */
835
			template (value) RequestPrimitive m_createAcpBase modifies m_create := {
836
				requestIdentifier := testcasename() & "-m_createAcp",
837
				resourceType := int1,
838
				primitiveContent := {accessControlPolicy := m_contentCreateAcp ()}
839
			};
840 841 842 843 844 845 846 847 848
			
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicyAnnc resource
			 */
			template (value) RequestPrimitive m_createAcpAnncBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createAcpAnnc",
				resourceType := int10001,
				primitiveContent := {accessControlPolicyAnnc := m_contentCreateAcpAnnc ()}
			};
849
				
850
        	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 := {
851
        		to_ := p_parentResourceAddress,
852
				requestIdentifier := testcasename() & "-m_createAcp",
853
        		resourceType := int1,
854
        		primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)}
855 856
        	};
        	
857 858 859 860 861 862
			/**
			 * @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,
863
				resourceType := int10001,
864
				primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnncBase(-)}
865 866
			};
        	
867 868 869 870 871 872 873
			/**
			  * @desc Reception template for CREATE AcpAnnc
			  */
			template RequestPrimitive mw_createRemoteCSEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?) modifies mw_create := {
				resourceType := int10016,
				primitiveContent := {remoteCSEAnnc := mw_contentCreateRemoteCSEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
			};
874 875 876 877
       	
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
			 */
878
        	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 := {
879
				requestIdentifier := testcasename() & "-m_createAcpAux",
880
        		resourceType := int1,
881
        		primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}
882 883
        	};
        	
884
			/*template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
885
				from_ := PX_SUPER_USER,
886
				requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000),
887
				resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all
888
				primitiveContent := {cSEBase := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}
889 890 891 892 893 894
			};*/
			
			/**
			 * @desc Base CREATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := {
895
				requestIdentifier := testcasename() & "-m_createCSEBase",
896
				resourceType := int5,
897
				primitiveContent := {cSEBase := m_contentCreateCSEBase}
898 899
			};
        	
900 901 902 903
       	
			/**
			 * @desc Base CREATE request primitive for Container resource
			 */
904
			template (value) RequestPrimitive m_createContainerBase modifies m_create := {
905
				requestIdentifier := testcasename() & "-m_createContainer",
906
				resourceType := int3,
907
				primitiveContent := {container := m_contentCreateContainer}
908
			};
909 910 911 912 913 914 915 916 917
			
			/**
			 * @desc Base CREATE request primitive for ContainerAnnc resource
			 */
			template (value) RequestPrimitive m_createContainerAnncBase modifies m_create := {
				requestIdentifier := testcasename() & "-m_createContainerAnnc",
				resourceType := int10003,
				primitiveContent := {containerAnnc := m_contentCreateContainerAnnc}
			};
918 919 920 921 922 923 924 925 926
			       	
			/**
			 * @desc Base CREATE request primitive for Container resource using Container_update_invalid
			 */
			template (value) RequestPrimitive m_createContainerBaseInvalid modifies m_create := {
				requestIdentifier := testcasename() & "-m_createContainer",
				resourceType := int3,
				primitiveContent := {container_update_invalid := m_contentCreateContainerInvalid}
			};
927
			
928 929 930
			/**
			 * @desc Base CREATE request primitive for remoteCSE resource
			 */
931
			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 := {
932
				requestIdentifier := testcasename() & "-m_createRemoteCSE",
933
				resourceType := int16,
934
				primitiveContent := {remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
935 936
			};
			
937 938 939 940 941 942 943
			/**
			 * @desc CREATE request primitive for remoteCSE resource with poa
			 */
			template (value) RequestPrimitive m_createRemoteCSE_poa(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, in PoaList p_poaList) modifies m_createRemoteCSEBase := {
				primitiveContent := {remoteCSE := m_contentCreateRemoteCSE_poa(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID, p_poaList)}
			};
			
944
			/**
945
			 * @desc Base reception template for CREATE RemoteCSE
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
946 947 948
			 */
			template RequestPrimitive mw_createRemoteCSE(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
				resourceType := int16,
949
				primitiveContent := {remoteCSE := mw_contentCreateRemoteCSEBase}
950 951
			};
			
952 953 954 955
			/**
			 * @desc CREATE request primitive for Container resource wiht no resourceName provided
			 */
			template (value) RequestPrimitive m_createContainer_noResourceName modifies m_createContainerBase := {
956
				primitiveContent := {container := m_contentCreateContainer(omit)}
957
			};
958
	
959
    		template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultContainerResourceName) modifies m_create := {
960
    			to_ := p_parentResourceAddress,
961
				requestIdentifier := testcasename() & "-m_createContainer",
962
    			resourceType := int3,
963
    			primitiveContent := {container := m_contentCreateContainer(p_resourceName)}
964 965
    		};
        	
966 967 968 969 970
			/**
			 * @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,
971
				primitiveContent := {container := mw_contentCreateContainerBase}
972 973
			};  
			
974
			/**
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
975
			 * @desc Base Reception template for CREATE ContainerAnnc
976
			 */
977
			template RequestPrimitive mw_createContainerAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
978
				resourceType := int10003,
979
				primitiveContent := {containerAnnc := mw_contentCreateContainerAnncBase}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
980
			};