blob: c6413f5e685922d73b41359b46cdfb31d9949186 [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2000-2019 Ericsson Telecom AB //
// //
// All rights reserved. This program and the accompanying materials //
// are made available under the terms of the Eclipse Public License v2.0 //
// which accompanies this distribution, and is available at //
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Module: EPTF_CLL_DsRestAPI_Timeline_Definitions
//
// Purpose:
// This module contains type definitions for TTCN-3 EPTF DsRestAPI Timeline
// implementation.
//
// Module Parameters:
//
// Module depends on:
// <EPTF_CLL_DataSource_Definitions>
//
// Current Owner:
// Daniel Gobor (ednigbo)
//
// Last Review Date:
//
//
// Detailed Comments:
// This module contains type definitions for TTCN-3 EPTF DsRestAPI Timeline
// implementation.
//
///////////////////////////////////////////////////////////////////////////////
module EPTF_CLL_DsRestAPI_Timeline_Definitions {
import from EPTF_CLL_DataSource_Definitions all;
import from EPTF_CLL_Logging_Definitions all;
import from EPTF_CLL_HashMap_Definitions all;
import from EPTF_CLL_RBTScheduler_Definitions all;
import from EPTF_CLL_DsRestAPI_DSServer_Definitions all;
type record EPTF_CLL_DsRestAPI_Timeline_SceduledRequestDescriptor {
integer varId,
charstring key,
integer maxpoints,
boolean collectionDisabled
}
type record of EPTF_CLL_DsRestAPI_Timeline_SceduledRequestDescriptor EPTF_CLL_DsRestAPI_Timeline_SceduledRequestDescriptors;
type record EPTF_CLL_DsRestAPI_Timeline_SceduledRequest {
EPTF_DsRestAPI_Requests request,
EPTF_CLL_DsRestAPI_Timeline_SceduledRequestDescriptors descriptors,
float period,
integer eventIndex,
integer responsesReceived,
integer responsesExpected,
integer lastMeasurement
}
type record of EPTF_CLL_DsRestAPI_Timeline_SceduledRequest EPTF_CLL_DsRestAPI_Timeline_SceduledRequests;
///////////////////////////////////////////////////////////////////////////////
// Type: EPTF_DsRestAPI_Timeline_CT
//
// Purpose:
// Collects and stores timeline data as a DataSource Client.
//
// Elements:
// - v_EPTF_DsRestAPI_Timeline_initialized - *boolean* - represents if the component is initialized
// - v_DsRestAPI_Timeline_loggingMaskId - *integer* - the logging mask id
// - v_EPTF_DsRestAPI_Timeline_scheduledRequests - *EPTF_CLL_DsRestAPI_Timeline_SceduledRequests* - the requests that are collected
// - v_startRequest - *EPTF_DsRestAPI_Requests* - the appended request that is used to start collecting
// - v_DsRestAPI_Timeline_started - *boolean* - represents if the collection is started
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////////////////////
type component EPTF_DsRestAPI_Timeline_CT
extends EPTF_DataSourceClient_CT, EPTF_Logging_CT, EPTF_HashMap_CT, EPTF_DsRestAPI_DSServer_CT, EPTF_Scheduler_CT {
private var boolean v_EPTF_DsRestAPI_Timeline_initialized := false;
private var integer v_DsRestAPI_Timeline_loggingMaskId := c_EPTF_Logging_invalidMaskId;
private var EPTF_CLL_DsRestAPI_Timeline_SceduledRequests v_EPTF_DsRestAPI_Timeline_scheduledRequests := {};
private var EPTF_DsRestAPI_Requests v_startRequest := {};
private var boolean v_DsRestAPI_Timeline_started := false;
}
const EPTF_Logging_EventClassPrefixList c_EPTF_DsRestAPI_Timeline_loggingEventClasses := { "Warning" };
const integer c_EPTF_DsRestAPI_Timeline_loggingClassIdx_Warning := 0;
const float c_DsRestAPI_Timeline_period := 3.0;
const integer c_DsRestAPI_Timeline_maxpoints := 255;
const integer c_DsRestAPI_Timeline_maxRequestSize := 10000;
const charstring c_DsRestAPI_Timeline_DataSource_sourceId := "DsRestAPI_Timeline";
const charstring c_DsRestAPI_Timeline_paramNamePeriod := "Period";
const charstring c_DsRestAPI_Timeline_paramNameMaxpoints := "Maxpoints";
const charstring c_DsRestAPI_Timeline_paramNameSince := "Since";
///////////////////////////////////////////////////////////////////////////////
// Constant: c_DsRestAPI_Timeline_dataElementTimeline
//
// Purpose:
// This dataElement returns the timeline for a given dataelement.
// The type of the value of the data is: charstringType
//
// Parameters:
// Period - *float* - The period with which the timeline is created for this dataelement (optional, default: 3.0).
// Maxpoints - *integer* - The number of max points specified.
// DeltaSince - *float* - Return only the part of the timeline (optional, default: whole timeline returned).
// Source - *charstring* - The original source of the timeline.
// PTCName - *charstring* - The original PTC name of the timeline.
// Element - *charstring* - The original element of the timeline.
//
///////////////////////////////////////////////////////////////////////////////
const charstring c_DsRestAPI_Timeline_dataElementTimeline := "Timeline";
const EPTF_DataSource_Help_DataElement c_DsRestAPI_Timeline_Help_dataElementTimeline := {
name := c_DsRestAPI_Timeline_dataElementTimeline,
valueType := charstringType,
description := "This dataElement returns the timeline for a given dataelement.",
parameters := {
{
name := c_DsRestAPI_Timeline_paramNamePeriod,
typeDescriptor := {
valueType := floatType
},
description := "The period with which the timeline is created for this dataelement (optional).",
exampleValue := "3.0"
}, {
name := c_DsRestAPI_Timeline_paramNameMaxpoints,
typeDescriptor := {
valueType := intType
},
description := "The number of max points specified (optional).",
exampleValue := "255"
}, {
name := c_DsRestAPI_Timeline_paramNameSince,
typeDescriptor := {
valueType := floatType
},
description := "Return only the part of the timeline, whose measurements were made since the given time (optional).",
exampleValue := "1476103390"
}, {
name := c_EPTF_DataSource_paramNameSource,
typeDescriptor := {
valueType := charstringType
},
description := "The original source of the timeline.",
exampleValue := "ExecCtrl"
}, {
name := c_EPTF_DataSource_paramNamePTCName,
typeDescriptor := {
valueType := charstringType
},
description := "The original PTC name of the timeline (optional).",
exampleValue := ""
}, {
name := c_EPTF_DataSource_paramNameElement,
typeDescriptor := {
valueType := charstringType
},
description := "The original element of the timeline. This parameter is followed by an optional list of the parameterName-Value pairs.",
exampleValue := "GlobalStat"
}, {
name := c_EPTF_DataSource_paramNameParamName,
typeDescriptor := {
valueType := charstringType
},
description := "The ParamName.",
exampleValue := "Statistic"
}, {
name := c_EPTF_DataSource_paramNameParamValue,
typeDescriptor := {
valueType := charstringType
},
description := "The ParamValue.",
exampleValue := "Success"
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Constant: c_DsRestAPI_Timeline_dataElementTimeline
//
// Purpose:
// This dataElement can be used to turn the data collection on or off.
// The type of the value of the data is: boolType
//
// Parameters:
// -
//
///////////////////////////////////////////////////////////////////////////////
const charstring c_DsRestAPI_Timeline_dataElementRunning := "Running";
const EPTF_DataSource_Help_DataElement c_DsRestAPI_Timeline_Help_dataElementRunning := {
name := c_DsRestAPI_Timeline_dataElementRunning,
valueType := boolType,
description := "This dataElement can be used to turn the data collection on or off.",
parameters := {}
}
///////////////////////////////////////////////////////////////////////////////
// Constant: c_DsRestAPI_Timeline_dataElementAppendFromFile
//
// Purpose:
// This dataElement can be used to add elements for which a timeline will be created in a SetDataValue request.
// The type of the value of the data is: charstringType
//
// Parameters:
// FileName - *charstring* - The name of the file that contains the request.
//
///////////////////////////////////////////////////////////////////////////////
const charstring c_DsRestAPI_Timeline_dataElementAppendFromFile := "AppendFromFile";
const EPTF_DataSource_Help_DataElement c_DsRestAPI_Timeline_Help_dataElementAppendFromFile := {
name := c_DsRestAPI_Timeline_dataElementAppendFromFile,
valueType := charstringType,
description := "This dataElement can be used to add elements for which a timeline will be created in a SetDataValue request.",
parameters := {
{
name := "FileName",
typeDescriptor := {
valueType := charstringType
},
description := "The name of the file that contains the request.",
exampleValue := "../request.json"
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Constant: c_DsRestAPI_Timeline_dataElementAppendFromJSON
//
// Purpose:
// This dataElement can be used to add elements for which a timeline will be created in a SetDataValue request.
// The type of the value of the data is: charstringType
//
// Parameters:
// Request - *charstring* - The request as a JSON string.
//
///////////////////////////////////////////////////////////////////////////////
const charstring c_DsRestAPI_Timeline_dataElementAppendFromJSON := "AppendFromJSON";
const EPTF_DataSource_Help_DataElement c_DsRestAPI_Timeline_Help_dataElementAppendFromJSON := {
name := c_DsRestAPI_Timeline_dataElementAppendFromJSON,
valueType := charstringType,
description := "This dataElement can be used to add elements for which a timeline will be created in a SetDataValue request.",
parameters := {
{
name := "Request",
typeDescriptor := {
valueType := charstringType
},
description := "The request as a JSON string.",
exampleValue := "[{\"getData\": {\"source\": \"ExecCtrl\", \"element\": \"TimeElapsed\", \"timeline\": {...}}}]"
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Constant: c_DsRestAPI_Timeline_dataElementClear
//
// Purpose:
// This dataElement can be used to clear all collected timelines in a SetDataValue request.
// The type of the value of the data is: charstringType
//
// Parameters:
// -
//
///////////////////////////////////////////////////////////////////////////////
const charstring c_DsRestAPI_Timeline_dataElementClear := "Clear";
const EPTF_DataSource_Help_DataElement c_DsRestAPI_Timeline_Help_dataElementClear := {
name := c_DsRestAPI_Timeline_dataElementClear,
valueType := charstringType,
description := "This dataElement can be used to clear all collected timelines in a SetDataValue request.",
parameters := {}
}
const EPTF_DataSource_Help_DataElementChildren c_EPTF_DsRestAPI_Timeline_help := {
{
dataElement := c_EPTF_DataSource_Help_dataElement_genericHelp
},
{
dataElement := c_DsRestAPI_Timeline_Help_dataElementTimeline
},
{
dataElement := c_DsRestAPI_Timeline_Help_dataElementRunning
},
{
dataElement := c_DsRestAPI_Timeline_Help_dataElementAppendFromFile
},
{
dataElement := c_DsRestAPI_Timeline_Help_dataElementAppendFromJSON
},
{
dataElement := c_DsRestAPI_Timeline_Help_dataElementClear
}
}
}