OneM2M_Templates.ttcn 202 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/ETSI
9 10 11 12 13 14 15 16 17
 *  @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;
18
    import from OneM2M_Functions all;
19

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

33 34

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

96 97 98 99
			/**
			 * @desc Base RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
100
			 */
101
			template (value) RequestPrimitive m_retrieve(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
102
				operation := int2,
103
				to_ := p_targetResourceAddress,
104
				from_ := p_originator,
105
				requestIdentifier := "m_retrieve" & f_rnd(1, 1000000),
106
				resourceType := omit,
107
				primitiveContent := omit,
108
				roleIDs := omit, 
109 110 111 112 113 114 115 116 117 118 119
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
120
				desiredIdentifierResultType := omit,
121 122
				tokens := omit,
				tokenIDs := omit,
123
				localTokenIDs := omit,
124 125 126
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
127 128
			};
        	
129 130 131 132 133
			/**
			 * @desc RETRIEVE request primitive for child references
			 * @param p_targetResourceAddress Target resource address
			 * @param p_originator Originator (from)
			 */
134
			template (value) RequestPrimitive m_retrieveChildResourceRefs(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, template (omit) ResourceTypeList p_resourceTypeList := omit) modifies m_retrieve := {
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
				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 := {},
150
					filterUsage := int1,
151 152 153 154 155 156 157
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
158 159
				}
			};
160

161 162 163 164
			/**
			 * @desc Base Receive RETRIEVE request primitive
			 * @param p_targetResourceAddress Target resource address
			 */
165
			template RequestPrimitive mw_retrieve(template XSD.ID p_targetResourceAddress) := {
166 167 168 169
				operation := int2,
				to_ := p_targetResourceAddress,
				from_ := ?,
				requestIdentifier := ?,
170
				resourceType := omit,
171
				primitiveContent := *,
172 173 174 175 176 177 178 179 180 181 182 183
				roleIDs := *, 
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
184
				desiredIdentifierResultType := *,
185 186 187
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
188 189 190
				tokenRequestIndicator := *,
				releaseVersionIndicator := ?,
				vendorInformation := *
191 192
			};
        	
193 194 195 196 197
			/**
			 * @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)
			 */
198
			template (value) RequestPrimitive m_retrieveAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := {
199
        		operation := int2,
200
        		to_ := p_targetResourceAddress,
201
        		from_ := p_originator,
202 203
        		requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000),
        		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
				desiredIdentifierResultType := omit,
218 219
				tokens := omit,
				tokenIDs := omit,
220
				localTokenIDs := omit,
221 222 223
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
224 225
        	};
        	
226 227 228 229 230
			/**
			 * @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)
231
			 */
232
			template (value) RequestPrimitive m_retrieveAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := {
233
				operation := int2,
234
				to_ := p_targetResourceAddress,
235
				from_ := p_originator,
236 237
				requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000),
				resourceType := omit,
238
				primitiveContent := {attributeList := p_attributeList},
239
				roleIDs := omit,
240 241 242 243 244 245 246 247 248 249 250
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
251
				desiredIdentifierResultType := omit,
252 253
				tokens := omit,
				tokenIDs := omit,
254
				localTokenIDs := omit,
255 256 257
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
258
			};
259 260 261 262 263 264 265
			
			/**
			  * @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)
		     */
266
			template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
267 268
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
269 270 271 272 273 274 275 276 277 278 279 280 281 282
					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 := {},
283
					filterUsage := p_filterUsage,
284 285 286 287 288 289 290
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
291 292 293
				}
			};
			
294 295 296 297 298 299 300 301 302 303 304
			/**
			  * @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
305 306 307 308 309 310 311
			/**
			  * @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
			 */
312
			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
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
				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, 
330 331 332 333 334 335 336
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
Pramod Kulkarni's avatar
Pramod Kulkarni committed
337 338
				}
			};
339
			/**
340
			  * @desc RETRIEVE request primtive containing the Desired Identifier Result Type in the desiredIdentifierResultType field and Filter Criteria in the filterCriteria field
341 342 343 344
			  * @param p_targetResourceAddress Target resource address 
			  * @param p_filterCriteria FilterCriteria
			  * @param p_originator Originator (from)
			 */
345
			template (value) RequestPrimitive m_retrieveDiscResTypeFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) DesIdResType p_desIdResType, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := {
346 347
				requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000),
				filterCriteria := {
348 349 350 351 352 353 354 355 356 357 358 359 360 361
					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 := {},
362
					filterUsage := p_filterUsage,
363 364 365 366 367 368 369
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
370
				},
371
				desiredIdentifierResultType := p_desIdResType
372 373 374
			};
			
			/**
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397
			  * @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,
398 399 400 401 402 403 404
					limit := omit,
					semanticsFilter_list := {},
					filterOperation := omit,
					contentFilterSyntax := omit,
					contentFilterQuery := omit,
					level := omit,
					offset := omit
405 406
				}
			};
407
			
408 409 410 411 412 413 414 415 416 417
			/**
			  * @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"
			};
			
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
			/**
			  * @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 := {},
436
				filterUsage := int1,
437 438 439 440 441 442 443 444
				limit := omit,
				semanticsFilter_list := {},
				filterOperation := omit,
				contentFilterSyntax := omit,
				contentFilterQuery := omit,
				level := omit,
				offset := omit
				
445 446 447
			}
			
			
448
			
449 450 451
    	}//end group Retrieve

    	group Update {
452
    		template (value) RequestPrimitive m_update := {
453 454
				operation := int3,
				to_ := "NotInitialized",
455
				from_ := "NotInitialized",
456
				requestIdentifier := "m_update",
457
				resourceType := omit,
458
				primitiveContent:= omit,
459
				roleIDs := omit, 
460 461 462 463 464 465 466 467 468 469 470
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
471
				desiredIdentifierResultType := omit,
472 473
				tokens := omit,
				tokenIDs := omit,
474
				localTokenIDs := omit,
475 476 477
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
478
			};
479
        	
480 481 482 483 484 485
						
			template RequestPrimitive mw_update(template XSD.ID p_from := *, template XSD.ID p_to := ?) := {
				operation := int3,
				to_ := p_to,
				from_ := p_from,
				requestIdentifier := ?,
486
				resourceType := omit,
487 488 489 490 491 492 493 494 495 496 497 498 499
				primitiveContent:= ?,
				roleIDs := *, 
				originatingTimestamp := *,
				requestExpirationTimestamp := *,
				resultExpirationTimestamp := *,
				operationExecutionTime := *,
				responseType := *,
				resultPersistence := *,
				resultContent := *,
				eventCategory := *,
				deliveryAggregation := *,
				groupRequestIdentifier := *,
				filterCriteria := *,
500
				desiredIdentifierResultType := *, 
501 502 503
				tokens := *,
				tokenIDs := *,
				localTokenIDs := *,
504 505 506
				tokenRequestIndicator := *,
				releaseVersionIndicator := ?,
				vendorInformation := *
507 508
			};
        	
509 510 511 512
			/**
			 * @desc Base UPDATE request primitive for Ae resource
			 */
			template (value) RequestPrimitive m_updateAeBase modifies m_update:= {
513
				requestIdentifier := "m_updateAe",
514
				primitiveContent:= {aE := m_contentUpdateAe}
515 516
			};
        	
517 518 519
			/**
			 * @desc Reception template for update Ae resource
			 */
520
			template  RequestPrimitive mw_updateAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
521 522 523 524 525
				resourceType := int2,
				primitiveContent:= {aE := ?}
			};
			 
        	
526 527 528 529
			/**
			 * @desc Base UPDATE request primitive for Container resource
			 */
			template (value) RequestPrimitive m_updateContainerBase modifies m_update:= {
530
				requestIdentifier := "m_updateContainer",
531
				primitiveContent:= {container := m_contentUpdateContainer}
532
			};
533
			
534 535 536 537 538 539 540
			/**
			 * @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
541 542 543 544
			/**
			 * @desc Base UPDATE request primitive for ContentInstance resource
			 */
			template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= {
545
				requestIdentifier := "m_updateContentInstance",
546
				primitiveContent:= {contentInstance := m_contentUpdateContentInstance}
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
547 548
			};
			
549 550 551
			/**
			 * @desc Base UPDATE request primitive for AccessControlPolicy resource
			 */        				
552
			template (value) RequestPrimitive m_updateAcpBase modifies m_update := {
553
				requestIdentifier := "m_updateAcp",
554
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcp}
555 556
			};
			
557
			template (value) RequestPrimitive m_updateAcpPrivileges(in template(omit) SetOfAcrs p_privileges := omit, in template(omit) SetOfAcrs p_selfPrivileges := omit) modifies m_update := {
558
				requestIdentifier := "m_updateAcp",
559
				primitiveContent:= {accessControlPolicy := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}
560
			};
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577

			/**
			 * @desc Base UPDATE request primitive for GenericInterworkingService resource
			 */
			template (value) RequestPrimitive m_updateGenericInterworkingServiceBase modifies m_update:= {
				requestIdentifier := "m_updateGenericInterworkingService",
				primitiveContent:= {genericInterworkingService := m_contentUpdateGenericInterworkingService}
			};

			/**
			 * @desc Base UPDATE request primitive for GenericInterworkingService_invalid resource
			 */
			template (value) RequestPrimitive m_updateGenericInterworkingServiceBase_invalid modifies m_update:= {
				requestIdentifier := "m_updateGenericInterworkingServiceInvalid",
				primitiveContent:= {genericInterworkingService_invalid := m_contentUpdateGenericInterworkingService_invalid}
			};
				
578 579 580
			/**
			 * @desc Base UPDATE request primitive for Group resource
			 */
581
			template (value) RequestPrimitive m_updateGroupBase modifies m_update := {
582
				requestIdentifier := "m_updateGroup",
583
				primitiveContent:= {group_ := m_contentUpdateGroup}
584 585
			};
			
586 587 588 589
			/**
			 * @desc Base UPDATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := {
590
				requestIdentifier := "m_updateGroup",
591
				primitiveContent:= {cSEBase := m_contentUpdateCSEBase}
592 593
			};
			
594 595 596
			/**
			 * @desc Base UPDATE request primitive for Schedule resource
			 */
597
			template (value) RequestPrimitive m_updateScheduleBase modifies m_update := {
598
				requestIdentifier := "m_updateSchedule",
599
				primitiveContent:= {schedule := m_contentUpdateSchedule}
600 601
			};
			
602 603 604
			/**
			 * @desc Base UPDATE request primitive for PollingChannel resource
			 */
605
			template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := {
606
				requestIdentifier := "m_updatePollingChannel",
607
				primitiveContent:= {pollingChannel := m_contentUpdatePollingChannel}
608 609
			};
			
610 611 612
			/**
			 * @desc Base UPDATE request primitive for Subscription resource
			 */
613
			template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := {
614
				requestIdentifier := "m_updateSubscription",
615
				primitiveContent:= {subscription := m_contentUpdateSubscription}
616
			};
617
			
618
			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
619
        	  	to_ 				:= p_locResourceAddress,
620
        	  	requestIdentifier	:= "m_updateLocationPolicy",
621
        	  	primitiveContent	:= {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)}
622
			  };
623
        	
624
        	template (value) RequestPrimitive m_updateNodeBase modifies m_update := {
625
				requestIdentifier := "m_updateNode",
626 627 628 629
				primitiveContent:= {node := m_contentUpdateNode}
        	}
        	
        	template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := {
630
			   requestIdentifier := "m_updateRemoteCSEBase",
631 632
        	   primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
        	}
633 634 635 636 637 638 639 640

			/**
			 * @desc Reception template for update remoteCSE resource
			 */
			template RequestPrimitive mw_updateRemoteCSE(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				primitiveContent:= {remoteCSE := ?}
			};
			       	
641
			template (value) RequestPrimitive m_updateAEAnncBase modifies m_update:= {
642
				requestIdentifier := testcasename() & "-m_updateAEAnnc",
643
				resourceType := int10002,
644
				primitiveContent := {aEAnnc := m_contentUpdateAEAnnc}
645
			};
646
			
647 648 649 650
			template RequestPrimitive mw_updateAEAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update:= {
				primitiveContent := {aEAnnc := ?}
			};
			
651 652 653 654
			/**
			 * @desc Base Reception template for update ContainerAnnc
			 */
			template RequestPrimitive mw_updateContainerAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
655

656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
				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 := {
				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 := {
				primitiveContent := {accessControlPolicyAnnc := ?}
671 672 673 674 675 676 677 678
			}; 	
			
			/**
			 * @desc Base UPDATE request primitive for TimeSeries resource
			 */
			template (value) RequestPrimitive m_updateTimeSeriesBase modifies m_update := {
				requestIdentifier := "m_updateTimeSeries",
				primitiveContent:= {timeSeries := m_contentUpdateTimeSeries}
679 680 681 682 683 684 685 686
			};
			
			/**
			 * @desc Base UPDATE request primitive for TimeSeriesInstance resource
			 */
			template (value) RequestPrimitive m_updateTimeSeriesInstanceBase modifies m_update:= {
				requestIdentifier := "m_updateTimeSeriesInstance",
				primitiveContent:= {timeSeriesInstance := m_contentUpdateTimeSeriesInstance}
687 688 689 690 691 692 693 694
			};		
			
			/**
			 * @desc Base Reception template for update TimeSeriesAnnc
			 */
			template RequestPrimitive mw_updateTimeSeriesAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
				primitiveContent := {timeSeriesAnnc := ?}
			}; 
695 696
			
			
697 698 699
    	}//end group Update
    	
    	group Create {
700 701 702 703 704

			template (value) RequestPrimitive m_create := {
				operation := int1,
				to_ := "NotInitialized",
				from_ := "NotInitialized",
705
				requestIdentifier := testcasename() & "-m_create",
706 707
				resourceType := omit,
				primitiveContent := omit,
708
				roleIDs := omit,
709 710 711 712 713 714 715 716 717 718 719
				originatingTimestamp := omit,
				requestExpirationTimestamp := omit,
				resultExpirationTimestamp := omit,
				operationExecutionTime := omit,
				responseType := omit,
				resultPersistence := omit,
				resultContent := omit,
				eventCategory := omit,
				deliveryAggregation := omit,
				groupRequestIdentifier := omit,
				filterCriteria := omit,
720
				desiredIdentifierResultType := omit,
721 722
				tokens := omit,
				tokenIDs := omit,
723
				localTokenIDs := omit,
724 725 726
				tokenRequestIndicator := omit,
				releaseVersionIndicator := "2a",
				vendorInformation := omit
727 728

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

816 817 818 819 820 821 822
			/**
			 * @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)}
			};
			
823
			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 := {
824
				from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
825
				requestIdentifier := testcasename() & "-m_createAe",
826
				resourceType := int2,
827
				primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds,p_resourceName, p_appId, p_poaList)}
828
			};
829
        	
830 831 832
			/**
			 * @desc Reception template for AE registration
			 */
Miguel Angel Reina Ortega's avatar
Fix #69  
Miguel Angel Reina Ortega committed
833
			template  RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?, template AE_optional p_ae := mw_contentCreateAeBase) modifies mw_create := {
834
				resourceType := int2,
835
				primitiveContent := {aE := p_ae}
836 837
			};  
			        	
838
        	template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := {
839
        		from_ := PX_TS_AE1.aeIdStem,//TODO We should use omit, "s", or "c"
840
				requestIdentifier := testcasename() & "-m_createAe",
841
        		resourceType := int2,
842
        		primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds, c_aeAuxName, -, p_poaList)}
843
			};
844
        	
845 846 847
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource
			 */
848
			template (value) RequestPrimitive m_createAcpBase modifies m_create := {
849
				requestIdentifier := testcasename() & "-m_createAcp",
850
				resourceType := int1,
851
				primitiveContent := {accessControlPolicy := m_contentCreateAcp ()}
852
			};
853 854 855 856 857 858 859 860 861
			
			/**
			 * @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 ()}
			};
862
				
863
        	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 := {
864
        		to_ := p_parentResourceAddress,
865
				requestIdentifier := testcasename() & "-m_createAcp",
866
        		resourceType := int1,
867
        		primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)}
868 869
        	};
        	
870 871 872 873 874 875
			/**
			 * @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,
876
				resourceType := int10001,
877
				primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnncBase(-)}
878 879
			};
        	
880 881 882 883 884 885 886
			/**
			  * @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)}
			};
887 888 889 890
       	
			/**
			 * @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
			 */
891
        	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 := {
892
				requestIdentifier := testcasename() & "-m_createAcpAux",
893
        		resourceType := int1,
894
        		primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}
895 896
        	};
        	
897
			/*template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := {
898
				from_ := PX_SUPER_USER,
899
				requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000),
900
				resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all
901
				primitiveContent := {cSEBase := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}
902 903 904 905 906 907
			};*/
			
			/**
			 * @desc Base CREATE request primitive for CSEBase resource
			 */
			template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := {
908
				requestIdentifier := testcasename() & "-m_createCSEBase",
909
				resourceType := int5,
910
				primitiveContent := {cSEBase := m_contentCreateCSEBase}
911 912
			};
        	
913 914 915 916
       	
			/**
			 * @desc Base CREATE request primitive for Container resource
			 */
917
			template (value) RequestPrimitive m_createContainerBase modifies m_create := {
918
				requestIdentifier := testcasename() & "-m_createContainer",
919
				resourceType := int3,
920
				primitiveContent := {container := m_contentCreateContainer}
921
			};
922 923 924 925 926 927 928 929 930
			
			/**
			 * @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}
			};
931 932 933 934 935 936 937 938 939
			       	
			/**
			 * @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}
			};
940
			
941 942 943
			/**
			 * @desc Base CREATE request primitive for remoteCSE resource
			 */
944
			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_TS_CSE1.cseId, in template (omit) XSD.ID p_cSE_ID := PX_TS_CSE1.cseId) modifies m_create := {
945
				requestIdentifier := testcasename() & "-m_createRemoteCSE",
946
				resourceType := int16,
947
				primitiveContent := {remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)}
948 949
			};
			
950 951 952
			/**
			 * @desc CREATE request primitive for remoteCSE resource with poa
			 */
953
			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_TS_CSE1.cseId & "/" & PX_TS_CSE1.cseName, in template (omit) XSD.ID p_cSE_ID := PX_TS_CSE1.cseId, in PoaList p_poaList) modifies m_createRemoteCSEBase := {
954 955 956
				primitiveContent := {remoteCSE := m_contentCreateRemoteCSE_poa(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID, p_poaList)}
			};
			
957
			/**
958
			 * @desc Base reception template for CREATE RemoteCSE
Antonio Castillo Verdugo's avatar