From f1ab6ce267695512898fa89aac2be3deeb8e1c8c Mon Sep 17 00:00:00 2001 From: "SLW\\ARNAUA" Date: Fri, 10 Mar 2023 15:50:17 +0100 Subject: [PATCH] updated --- DE-3/TP_Mobile_Send2VehicleMGU.yaml | 2 +- DE-4/TP_Mobile_PersonalFavorites.yaml | 2 +- DE-7/TP_Mobile_DigitalKey.yaml | 2 +- Jenkinsfile | 2 +- README.md | 225 ++++++++++++++++-- generate.py | 49 ++-- jinja-templates/terraform-template-4.j2 | 4 +- output/CN_Prod/slo/TP_Mobile_DigitalKey.tf | 51 ++++ output/CN_Prod/slo/TP_Mobile_Login.tf | 59 +++++ output/CN_Prod/slo/TP_Mobile_Mapping.tf | 55 +++++ .../slo/TP_Mobile_PersonalFavorites.tf | 47 ++++ output/CN_Prod/slo/TP_Mobile_Remote360.tf | 57 +++++ .../CN_Prod/slo/TP_Mobile_RemoteServices.tf | 61 +++++ .../slo/TP_Mobile_Send2VehicleLegacy.tf | 34 +++ .../CN_Prod/slo/TP_Mobile_Send2VehicleMGU.tf | 45 ++++ output/CN_Prod/slo/TP_Mobile_VehicleData.tf | 43 ++++ output/CN_Prod/slo/TP_Mobile_VehicleList.tf | 43 ++++ output/CN_Prod/slo/TP_Vehicle_FTS.tf | 34 +++ output/CN_Prod/slo/TP_Vehicle_RTTI.tf | 35 +++ output/EMEA_Prod/slo/TP_Mobile_DigitalKey.tf | 51 ++++ output/EMEA_Prod/slo/TP_Mobile_Login.tf | 37 +++ output/EMEA_Prod/slo/TP_Mobile_Mapping.tf | 67 ++++++ .../slo/TP_Mobile_PersonalFavorites.tf | 59 +++++ output/EMEA_Prod/slo/TP_Mobile_Remote360.tf | 57 +++++ .../EMEA_Prod/slo/TP_Mobile_RemoteServices.tf | 61 +++++ .../slo/TP_Mobile_Send2VehicleLegacy.tf | 34 +++ .../slo/TP_Mobile_Send2VehicleMGU.tf | 45 ++++ output/EMEA_Prod/slo/TP_Mobile_VehicleData.tf | 47 ++++ output/EMEA_Prod/slo/TP_Mobile_VehicleList.tf | 45 ++++ output/EMEA_Prod/slo/TP_Vehicle_FTS.tf | 36 +++ output/EMEA_Prod/slo/TP_Vehicle_RTTI.tf | 35 +++ output/EMEA_Prod/slo/TP_Vehicle_eRoute.tf | 37 +++ output/NA_Prod/slo/TP_Mobile_DigitalKey.tf | 51 ++++ output/NA_Prod/slo/TP_Mobile_Login.tf | 49 ++++ output/NA_Prod/slo/TP_Mobile_Mapping.tf | 69 ++++++ .../slo/TP_Mobile_PersonalFavorites.tf | 55 +++++ output/NA_Prod/slo/TP_Mobile_Remote360.tf | 57 +++++ .../NA_Prod/slo/TP_Mobile_RemoteServices.tf | 67 ++++++ .../slo/TP_Mobile_Send2VehicleLegacy.tf | 34 +++ .../NA_Prod/slo/TP_Mobile_Send2VehicleMGU.tf | 45 ++++ output/NA_Prod/slo/TP_Mobile_VehicleData.tf | 45 ++++ output/NA_Prod/slo/TP_Mobile_VehicleList.tf | 45 ++++ output/NA_Prod/slo/TP_Vehicle_FTS.tf | 36 +++ output/NA_Prod/slo/TP_Vehicle_RTTI.tf | 45 ++++ output/NA_Prod/slo/TP_Vehicle_eRoute.tf | 37 +++ slo-templates/TP_Template.yaml | 4 +- 46 files changed, 2047 insertions(+), 53 deletions(-) create mode 100644 output/CN_Prod/slo/TP_Mobile_DigitalKey.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_Login.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_Mapping.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_PersonalFavorites.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_Remote360.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_RemoteServices.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_Send2VehicleMGU.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_VehicleData.tf create mode 100644 output/CN_Prod/slo/TP_Mobile_VehicleList.tf create mode 100644 output/CN_Prod/slo/TP_Vehicle_FTS.tf create mode 100644 output/CN_Prod/slo/TP_Vehicle_RTTI.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_DigitalKey.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_Login.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_Mapping.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_PersonalFavorites.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_Remote360.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_RemoteServices.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_Send2VehicleMGU.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_VehicleData.tf create mode 100644 output/EMEA_Prod/slo/TP_Mobile_VehicleList.tf create mode 100644 output/EMEA_Prod/slo/TP_Vehicle_FTS.tf create mode 100644 output/EMEA_Prod/slo/TP_Vehicle_RTTI.tf create mode 100644 output/EMEA_Prod/slo/TP_Vehicle_eRoute.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_DigitalKey.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_Login.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_Mapping.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_PersonalFavorites.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_Remote360.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_RemoteServices.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_Send2VehicleMGU.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_VehicleData.tf create mode 100644 output/NA_Prod/slo/TP_Mobile_VehicleList.tf create mode 100644 output/NA_Prod/slo/TP_Vehicle_FTS.tf create mode 100644 output/NA_Prod/slo/TP_Vehicle_RTTI.tf create mode 100644 output/NA_Prod/slo/TP_Vehicle_eRoute.tf diff --git a/DE-3/TP_Mobile_Send2VehicleMGU.yaml b/DE-3/TP_Mobile_Send2VehicleMGU.yaml index 798a2d2..b62b8ac 100644 --- a/DE-3/TP_Mobile_Send2VehicleMGU.yaml +++ b/DE-3/TP_Mobile_Send2VehicleMGU.yaml @@ -1,6 +1,6 @@ --- slo_id: "7" -slo_name: 'TP_Mobile_Send2VehicleMGU' +slo_name: "TP_Mobile_Send2VehicleMGU" displayname: "Send to Vehicle (MGU)" department: "DE-320" description: "2.0 SLO Mobile" diff --git a/DE-4/TP_Mobile_PersonalFavorites.yaml b/DE-4/TP_Mobile_PersonalFavorites.yaml index 3e12c93..835011c 100644 --- a/DE-4/TP_Mobile_PersonalFavorites.yaml +++ b/DE-4/TP_Mobile_PersonalFavorites.yaml @@ -1,6 +1,6 @@ --- slo_id: "9" -slo_name: 'TP_Mobile_PersonalFavorites' +slo_name: "TP_Mobile_PersonalFavorites" displayname: "Personal Favorites" department: "DE-443" description: "2.0 SLO Mobile" diff --git a/DE-7/TP_Mobile_DigitalKey.yaml b/DE-7/TP_Mobile_DigitalKey.yaml index cf49c8d..08e4627 100644 --- a/DE-7/TP_Mobile_DigitalKey.yaml +++ b/DE-7/TP_Mobile_DigitalKey.yaml @@ -1,6 +1,6 @@ --- slo_id: "10" -slo_name: 'TP_Mobile_DigitalKey' +slo_name: "TP_Mobile_DigitalKey" displayname: "Digital Key" department: "DE-730" description: "2.0 SLO Mobile" diff --git a/Jenkinsfile b/Jenkinsfile index dd77aa5..c75d97b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -104,7 +104,7 @@ pwd python3 --version pip3 --version - pip3 install --user -r ./coco_apm_slo_yaml2tf/requirements.txt + pip3 install --user -r ./coco_apm_slo_yaml2tf/requirements.txt ''' } } diff --git a/README.md b/README.md index 2c611a3..f82cde2 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,214 @@ # YAML 2 Terraform Generator -## Description -The task was to create a first draft of a script that can use a specific YAML file datastructure to generate Terraform configuration files. Afterwards it can be used as part of a Jenkins pipeline. -## Info - - YAML files should be stored according to the business line - - DE-3 - - DE-4 - - DE-7 - - EC-DE - - Some YAML files have been created for testing purposes based on the shared_configuration and CoCo_Terraform_Config repositories. +## Table of contents +[**1. Description**](#description)
+[**2. Info**](#info)
+[**3. Repositories**](#repositories)
+[**4. Requirements**](#requirements)
+[**5. Documentation**](#documentation)
+ + +## **1. Description** +This repository contains a first draft script that can use a specific YAML file datastructure in order to generate Terraform configuration files. Afterwards it is used to be part of a Jenkins pipeline. + + +## **2. Info** + - The current version of this script is able to generate Terraform files that support the metrics mentioned within section Supported Metrics. Therefore not all use cases might be covered! + - YAML files should be stored according to the business line (DE-3, DE-4, DE-7, EC-DE) within the respective business line folder! + - Some YAML files have already been created for testing purposes based on the shared_configuration and coco_terraform_config repositories and were therefore added in this repository. + +## **3 Repositories** +The following repositores have been used to create some YAML files. - [shared_configuration](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/shared_configuration) -- [CoCo_Terraform_Config](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/coco_terraform_config) +- [coco_terraform_config](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/coco_terraform_config) -## Requirements -### Python + +## **4. Requirements** + +### **Python** The used python version for running the script is 3.11.2. -### Libraries -Some python packages need to be installed. Please use the requirements.txt file to install missing packages. -## Running the program -Using the program is straightforward. -- `.\generate.py ` -- Example: `.\generate.py DE-3` -- `.\generate DE-3,DE-4,DE-7,EC-DE` +### **Libraries** +Some python packages need to be installed. Please use the requirements.txt file to install missing packages. The command for installing the missing packages is: +```sh +pip3 install --user -r requirements.txt +``` + +## **5. Documentation** +The following section is just a small exhibit tailored to the use of the script. +### **Arguments** +If the script needs to be used for local execution, then the following command should be used: + +``` +.\generate.py +``` +Please note that two arguments are necessary: + - `` - Here it is necessary to provide the path to the folder where the yaml files are stored. Fore example, if the yaml files are stored within the DE-3 business line folder, then it is important to convey the correct path as an argument for the script, in this case `.\DE-3\`. It is also possible to provide multiple folders, but they have to be delimited by a comma when parsing, in this case `.\DE-3\,.\DE-4\,.\DE-7\`! + - `` - If it is necessary to store the generated Terraform files to a specific location, then the correct path to that particular folder needs to be provided! Alternatively, the default path `.\output\` will be used which is within the current working directory of the script. + +#### **Examples** +Here are some examples when executing the script: +```sh +# The YAML Files are stored within the business line folder DE-3, in the same working directory as the script, and by the following command it is possible to generate the Terraform files and store them into the default output folder. +.\generate.py .\DE-3\ +``` +```sh +# The YAML Files are stored within the business line folder DE-3, in the same working directory as the script, and by the following command it is possible to generate the Terraform files and store them to a folder at a different location. +.\generate.py .\DE-3\ ..\coco_terraform_config\ +``` +```sh +# The YAML Files are stored within the business line folder DE-3, outside the working directory of the script, and by the following command it is possible to generate the Terraform files and store them to a folder at a different location. +.\generate.py ..\shared_configuration\DE-3\ ..\coco_terraform_config\ +``` +```sh +# The YAML Files are stored within multiple business line folders (DE-3, DE-4, DE-7), in the same working directory as the script, and by the following command it is possible to generate the Terraform files and store them into the default output folder. +.\generate.py .\DE-3\,.\DE-4\,.\DE-7\ +``` +```sh +# The YAML Files are stored within multiple business line folders (DE-3, DE-4, DE-7), in the same working directory as the script, and by the following command it is possible to generate the Terraform files and store them to a folder at a different location. +.\generate.py .\DE-3\,.\DE-4\,.\DE-7\ ..\coco_terraform_config\ +``` +```sh +# The YAML Files are stored within multiple business line folders and outside the working directory of the script. By using the following command it is possible to generate the Terraform files and store them to a folder at a different location. +.\generate.py ..\shared_configuration\DE-3\,..\shared_configuration\DE-4\,..\shared_configuration\DE-7\ ..\coco_terraform_config\ +# Note here: If all yaml files of the shared_configuration repository need to be provided as an input argument it would also suffice to use the following command: +.\generate.py ..\shared_configuration\ ..\coco_terraform_config\ +``` +### **Jenkins Pipeline** +This is the link to the pipeline: +[Pipeline CoCo SLO YAML 2 TF](https://jaws.bmwgroup.net/opapm/job/CoCo%20SLO%20YAML%202%20TF/). There are basically five main stages: + - Fetch Repositories: + - [shared_configuration](https://atc.bmwgroup.net/bitbucket/scm/opapm/shared_configuration.git) + - [coco_terraform_config](https://atc.bmwgroup.net/bitbucket/scm/opapm/coco_terraform_config.git) + - [coco_apm_slo_yaml2tf](https://atc.bmwgroup.net/bitbucket/scm/opapm/coco_apm_slo_yaml2tf.git) + - Checkout New Branch: A new branch is checked out (with a timestamp) which will be needed before any changes can be made after the script is run. The branch name will be something like ***-automatedSLOGeneration***. + - Install Required Python Packages: It is necessary to install the required packages before the script can be run! + - Execute Script: The script is executed and the YAML files with the corresponding business lines + - Push Changes: Once the script finished with its exection the changes will be pushed with a commit that just includes a timestamp. The changes will be pushed to the newly created branch as mentioned above! + +### **Data Structure of the YAML Files** +The majority of the key and value pairs have been taken respectively from the [shared_configuration](https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/shared_configuration/) repository. + +> ⚠️ **Please make sure that the YAML File does not include any tabs otherwise the correct functionality cannot be assured!** + +```yaml +slo_id: # - Order of the given SLO within the dashboard +slo_name: # - Touchpoint Mobile or Vehicle +displayname: # - Display name of the SLO to be displayed on the dashboard +department: # - Department/Business Line, responsible for this SLO +description: # - Description Field: CoCo QM-Report_Mobile or CoCo QM-Report_Vehicle +doc_url: # - Link to the documenation of the particular SLO +slo_definition: + tresholds: + warning: # - Traffic light orange + failure: # - Traffic light red + EMEA-Prod: + - metric: # - Used metric, see section Supported Metrics + filter: + - service: # - Name of the Service + keyRequests: + - # - The name of the particular Key-Request of that Service + - # - ... + - service: # - ... + keyRequests: + - # + NA-Prod: + - metric: # + filter: + - service: # + keyRequests: # + - # + - # + - service: # + keyRequests: + - # + CN-Prod: + - metric: # + filter: + - service: # + keyRequests: # + - # + - # + - service: # + keyRequests: + - # +``` + +#### **Supported Metrics** +Currently the following metrics are supported: +```yaml +builtin:service.keyRequest.errors.fivexx.rate +builtin:service.keyRequest.errors.server.successCount +builtin:service.keyRequest.errors.fivexx.count +builtin:service.errors.server.successCount +builtin:service.errors.fivexx.successCount +``` +### **Jinja Templates** +Currently there are only five Jinja Templates setup to cover mainly five different types of metrics as mentioned before. They can be found within the jinja-templates folder. +```sh +├───jinja-templates +│ terraform-template-1.j2 +│ terraform-template-2.j2 +│ terraform-template-3.j2 +│ terraform-template-4.j2 +│ terraform-template-5.j2 +``` +- terraform-template-1.j2 is used for builtin:service.keyRequest.errors.fivexx.rate +- terraform-template-2.j2 is used for builtin:service.keyRequest.errors.server.successCount +- terraform-template-3.j2 is used for builtin:service.keyRequest.errors.fivexx.count +- terraform-template-4.j2 is used for builtin:service.errors.server.successCount +- terraform-template-5.j2 is used for builtin:service.errors.fivexx.successCount + +### **Terraform Output Folder Structure** +The output folder structure will look like the following example: +```sh +C:.s +├───CN_Prod +│ └───slo +│ TP_Mobile_DigitalKey.tf +│ TP_Mobile_Login.tf +│ TP_Mobile_Mapping.tf +│ TP_Mobile_PersonalFavorites.tf +│ TP_Mobile_Remote360.tf +│ TP_Mobile_RemoteServices.tf +│ TP_Mobile_Send2VehicleLegacy.tf +│ TP_Mobile_Send2VehicleMGU.tf +│ TP_Mobile_VehicleData.tf +│ TP_Mobile_VehicleList.tf +│ TP_Vehicle_FTS.tf +│ TP_Vehicle_RTTI.tf +│ +├───EMEA_Prod +│ └───slo +│ TP_Mobile_DigitalKey.tf +│ TP_Mobile_Login.tf +│ TP_Mobile_Mapping.tf +│ TP_Mobile_PersonalFavorites.tf +│ TP_Mobile_Remote360.tf +│ TP_Mobile_RemoteServices.tf +│ TP_Mobile_Send2VehicleLegacy.tf +│ TP_Mobile_Send2VehicleMGU.tf +│ TP_Mobile_VehicleData.tf +│ TP_Mobile_VehicleList.tf +│ TP_Vehicle_eRoute.tf +│ TP_Vehicle_FTS.tf +│ TP_Vehicle_RTTI.tf +│ +└───NA_Prod + └───slo + TP_Mobile_DigitalKey.tf + TP_Mobile_Login.tf + TP_Mobile_Mapping.tf + TP_Mobile_PersonalFavorites.tf + TP_Mobile_Remote360.tf + TP_Mobile_RemoteServices.tf + TP_Mobile_Send2VehicleLegacy.tf + TP_Mobile_Send2VehicleMGU.tf + TP_Mobile_VehicleData.tf + TP_Mobile_VehicleList.tf + TP_Vehicle_eRoute.tf + TP_Vehicle_FTS.tf + TP_Vehicle_RTTI.tf +``` diff --git a/generate.py b/generate.py index 7bc578d..222b63a 100644 --- a/generate.py +++ b/generate.py @@ -7,9 +7,9 @@ import yaml import os from nested_lookup import nested_lookup from pathlib import Path +import datetime # defines -OUTPUT_FOLDER_BASENAME = os.path.basename("output") TEMPLATE_FOLDER_BASENAME = os.path.basename("jinja-templates") TEMPLATE_FILES = { "terraform-template-1.j2":["builtin:service.keyRequest.errors.fivexx.rate"], @@ -34,11 +34,6 @@ def template_logic(metric): # main def main(configFile,output_path): - if output_path: - op = output_path - else: - op = OUTPUT_FOLDER_BASENAME - slo_id = None slo_name = None module_name = None @@ -75,12 +70,8 @@ def main(configFile,output_path): slo["slo_definition"].pop("tresholds") for env in slo["slo_definition"]: - if "EMEA-Prod" in slo["slo_definition"]: - environments["EMEA-Prod"] = slo["slo_definition"][env] - if "NA-Prod" in slo["slo_definition"]: - environments["NA-Prod"] = slo["slo_definition"][env] - if "CN-Prod" in slo["slo_definition"]: - environments["CN-Prod"] = slo["slo_definition"][env] + if env in slo["slo_definition"]: + environments[env] = slo["slo_definition"][env] # read template file jinja_environment = jinja2.Environment(loader=jinja2.FileSystemLoader(TEMPLATE_FOLDER_BASENAME), @@ -116,20 +107,26 @@ if __name__ == "__main__": # pre-initialization get current working directory cwd = os.getcwd() - print("Current working directory:",cwd) + OUTPUT_FOLDER_BASENAME = os.path.basename("output") - if len(sys.argv) != 3: - print(".\generate.py ") - print("Example: .\generate.py .\DE-3\\ .\test\\") - print("Example: .\generate.py .\DE-3\,.\DE-4\,...") + if len(sys.argv) <= 1 or len(sys.argv) > 3: + print(datetime.datetime.now(),".\generate.py ") + print(datetime.datetime.now(),"Example: .\generate.py .\DE-3\ .\generated\\") + print(datetime.datetime.now(),"Example: .\generate.py .\DE-3\,.\DE-4\,... .\generated\\") + print(datetime.datetime.now(),"Missing input arguments. Exiting...") sys.exit() - print("Script is running...") - print("Check arguments:",sys.argv) + print(datetime.datetime.now(),"Script is running...") + print(datetime.datetime.now(),"Current working directory:",cwd) + print(datetime.datetime.now(),"Check arguments:",sys.argv) + if len(sys.argv) == 3: + op = sys.argv[2] + else: + op = OUTPUT_FOLDER_BASENAME - # TESTING: Unocmment this if you want to test it + # TESTING # for folderName,businessLine in FOLDERS.items(): - # businessLinePath = os.path.join(cwd,businessLine) + # businessLinePath = os.path.join(businessLine) # if not os.path.exists(businessLinePath): # os.makedirs(businessLinePath) @@ -137,15 +134,15 @@ if __name__ == "__main__": arguments = sys.argv[1].split(',') for arg in arguments: pathname = os.path.join(arg) - print("pathname:",pathname) + print(datetime.datetime.now(),"pathname:",pathname) # return path of slo config files configFiles = glob.glob(pathname=pathname + '/**/[TP_]*.yaml', # root_dir=os.path.join(cwd,os.path.basename(arg)), recursive=True) - print("configFiles:",configFiles) + print(datetime.datetime.now(),"configFiles:",configFiles) # for each slo config file in folder for configFile in configFiles: - print("File:",configFile) - main(configFile,sys.argv[2]) - print("Script finished.") \ No newline at end of file + print(datetime.datetime.now(),"Generating Terraform Files for:",configFile) + main(configFile,op) + print(datetime.datetime.now(),"Script finished.") \ No newline at end of file diff --git a/jinja-templates/terraform-template-4.j2 b/jinja-templates/terraform-template-4.j2 index e4c37dc..d02a054 100644 --- a/jinja-templates/terraform-template-4.j2 +++ b/jinja-templates/terraform-template-4.j2 @@ -12,12 +12,12 @@ module {{ module }} { # metric expression of the calculation as done in data explorer ui metric_expression = </password~", + ~"GET /api/v1/digitalkey//pairing~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"TrackApi - smc - PROD~", + ~"digital-key-composite-service - PROD~" + ) + ),entityName.in( + ~"trackKey~", + ~"manageKey~", + ~"GET /api/v1/digitalkey//password~", + ~"GET /api/v1/digitalkey//pairing~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/CN_Prod/slo/TP_Mobile_Login.tf b/output/CN_Prod/slo/TP_Mobile_Login.tf new file mode 100644 index 0000000..3559643 --- /dev/null +++ b/output/CN_Prod/slo/TP_Mobile_Login.tf @@ -0,0 +1,59 @@ +module TP_Mobile_Login { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Login" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </primary~", + ~"POST /api/v2/vehicles//primary/map~", + ~"POST /api/v1/vehicles//validate-security-code~", + ~"POST /api/v1/vehicles//resend-security-code~", + ~"DELETE /api/v1/vehicles/~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-user-composite-service - PROD~", + ~"vehicle-mapping-composite-service - PROD~" + ) + ),entityName.in( + ~"GET /api/v2/presentation/users/validate~", + ~"POST /api/v2/vehicles//primary~", + ~"POST /api/v2/vehicles//primary/map~", + ~"POST /api/v1/vehicles//validate-security-code~", + ~"POST /api/v1/vehicles//resend-security-code~", + ~"DELETE /api/v1/vehicles/~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/CN_Prod/slo/TP_Mobile_PersonalFavorites.tf b/output/CN_Prod/slo/TP_Mobile_PersonalFavorites.tf new file mode 100644 index 0000000..6fc088f --- /dev/null +++ b/output/CN_Prod/slo/TP_Mobile_PersonalFavorites.tf @@ -0,0 +1,47 @@ +module TP_Mobile_PersonalFavorites { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_PersonalFavorites" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = <~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-destination-composite-service - PROD~" + ) + ),entityName.in( + ~"GET /api/v3/favorites/~", + ~"POST /api/v3/favorites/~", + ~"PUT /api/v3/favorites/~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/CN_Prod/slo/TP_Mobile_Remote360.tf b/output/CN_Prod/slo/TP_Mobile_Remote360.tf new file mode 100644 index 0000000..0d44337 --- /dev/null +++ b/output/CN_Prod/slo/TP_Mobile_Remote360.tf @@ -0,0 +1,57 @@ +module TP_Mobile_Remote360 { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Remote360" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = <~", + ~"POST /api/v1/download/[UUID]//confirm~", + ~"GET /api/v1/vehicle//egomodelurl~", + ~"GET /api/v1/vehicle//key~", + ~"GET /api/v1/recordings/vehicle/~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"remote-360-composite-service - PROD~" + ) + ),entityName.in( + ~"GET /api/v1/events/[UUID]~", + ~"POST /api/v1/events/[UUID]/cancel~", + ~"POST /api/v1/event/execute~", + ~"GET /api/v1/download/[UUID]/~", + ~"POST /api/v1/download/[UUID]//confirm~", + ~"GET /api/v1/vehicle//egomodelurl~", + ~"GET /api/v1/vehicle//key~", + ~"GET /api/v1/recordings/vehicle/~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/CN_Prod/slo/TP_Mobile_RemoteServices.tf b/output/CN_Prod/slo/TP_Mobile_RemoteServices.tf new file mode 100644 index 0000000..2559def --- /dev/null +++ b/output/CN_Prod/slo/TP_Mobile_RemoteServices.tf @@ -0,0 +1,61 @@ +module TP_Mobile_RemoteServices { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_RemoteServices" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </door-lock~", + ~"POST /api/v2/presentation/remote-commands//door-unlock~", + ~"POST /api/v2/presentation/remote-commands//climate-now~", + ~"GET /api/v2/presentation/remote-history/~", + ~"POST /api/v2/presentation/remote-commands//horn-blow~", + ~"POST /api/v2/presentation/remote-commands//climate-timer~", + ~"POST /api/v2/presentation/remote-commands//light-flash~", + ~"POST /api/v2/presentation/remote-commands//vehicle-finder~", + ~"GET /api/v1/presentation/remote-history/~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-vehicle-remote-commands-composite-service - PROD~" + ) + ),entityName.in( + ~"POST /api/v2/presentation/remote-commands/eventStatus~", + ~"POST /api/v2/presentation/remote-commands//door-lock~", + ~"POST /api/v2/presentation/remote-commands//door-unlock~", + ~"POST /api/v2/presentation/remote-commands//climate-now~", + ~"GET /api/v2/presentation/remote-history/~", + ~"POST /api/v2/presentation/remote-commands//horn-blow~", + ~"POST /api/v2/presentation/remote-commands//climate-timer~", + ~"POST /api/v2/presentation/remote-commands//light-flash~", + ~"POST /api/v2/presentation/remote-commands//vehicle-finder~", + ~"GET /api/v1/presentation/remote-history/~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/CN_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf b/output/CN_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf new file mode 100644 index 0000000..1b9a970 --- /dev/null +++ b/output/CN_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf @@ -0,0 +1,34 @@ +module TP_Mobile_Send2VehicleLegacy { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Send2VehicleLegacy" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </password~", + ~"GET /api/v1/digitalkey//pairing~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"TrackApi - smc - PROD~", + ~"digital-key-composite-service - PROD~" + ) + ),entityName.in( + ~"trackKey~", + ~"manageKey~", + ~"GET /api/v1/digitalkey//password~", + ~"GET /api/v1/digitalkey//pairing~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/EMEA_Prod/slo/TP_Mobile_Login.tf b/output/EMEA_Prod/slo/TP_Mobile_Login.tf new file mode 100644 index 0000000..68ca933 --- /dev/null +++ b/output/EMEA_Prod/slo/TP_Mobile_Login.tf @@ -0,0 +1,37 @@ +module TP_Mobile_Login { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Login" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </primary~", + ~"POST /api/v2/vehicles//primary/map~", + ~"POST /api/v1/vehicles//validate-security-code~", + ~"POST /api/v1/vehicles//resend-security-code~", + ~"DELETE /api/v1/vehicles/~", + ~"POST /api/v3/mappings/create~", + ~"POST /api/v3/mappings/continue~", + ~"POST /api/v3/mappings/validate-security-code~", + ~"POST /api/v3/mappings/resend-security-code~", + ~"GET /api/v3/images/~", + ~"DELETE /api/v3/mappings~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-user-composite-service - PROD~", + ~"vehicle-mapping-composite-service - PROD~" + ) + ),entityName.in( + ~"GET /api/v2/presentation/users/validate~", + ~"POST /api/v2/vehicles//primary~", + ~"POST /api/v2/vehicles//primary/map~", + ~"POST /api/v1/vehicles//validate-security-code~", + ~"POST /api/v1/vehicles//resend-security-code~", + ~"DELETE /api/v1/vehicles/~", + ~"POST /api/v3/mappings/create~", + ~"POST /api/v3/mappings/continue~", + ~"POST /api/v3/mappings/validate-security-code~", + ~"POST /api/v3/mappings/resend-security-code~", + ~"GET /api/v3/images/~", + ~"DELETE /api/v3/mappings~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/EMEA_Prod/slo/TP_Mobile_PersonalFavorites.tf b/output/EMEA_Prod/slo/TP_Mobile_PersonalFavorites.tf new file mode 100644 index 0000000..ebe8215 --- /dev/null +++ b/output/EMEA_Prod/slo/TP_Mobile_PersonalFavorites.tf @@ -0,0 +1,59 @@ +module TP_Mobile_PersonalFavorites { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_PersonalFavorites" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = <~", + ~"PUT /api/v3/favorites/~", + ~"PUT /api/v2/favorites/homework/1~", + ~"PUT /api/v2/favorites/homework/2~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-destination-composite-service - PROD~" + ) + ),entityName.in( + ~"POST /api/v2/favorites/~", + ~"POST /api/v3/favorites/~", + ~"GET /api/v2/favorites/~", + ~"GET /api/v3/favorites/~", + ~"GET /api/v1/favorites~", + ~"PUT /api/v2/favorites/~", + ~"PUT /api/v3/favorites/~", + ~"PUT /api/v2/favorites/homework/1~", + ~"PUT /api/v2/favorites/homework/2~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/EMEA_Prod/slo/TP_Mobile_Remote360.tf b/output/EMEA_Prod/slo/TP_Mobile_Remote360.tf new file mode 100644 index 0000000..0d44337 --- /dev/null +++ b/output/EMEA_Prod/slo/TP_Mobile_Remote360.tf @@ -0,0 +1,57 @@ +module TP_Mobile_Remote360 { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Remote360" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = <~", + ~"POST /api/v1/download/[UUID]//confirm~", + ~"GET /api/v1/vehicle//egomodelurl~", + ~"GET /api/v1/vehicle//key~", + ~"GET /api/v1/recordings/vehicle/~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"remote-360-composite-service - PROD~" + ) + ),entityName.in( + ~"GET /api/v1/events/[UUID]~", + ~"POST /api/v1/events/[UUID]/cancel~", + ~"POST /api/v1/event/execute~", + ~"GET /api/v1/download/[UUID]/~", + ~"POST /api/v1/download/[UUID]//confirm~", + ~"GET /api/v1/vehicle//egomodelurl~", + ~"GET /api/v1/vehicle//key~", + ~"GET /api/v1/recordings/vehicle/~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/EMEA_Prod/slo/TP_Mobile_RemoteServices.tf b/output/EMEA_Prod/slo/TP_Mobile_RemoteServices.tf new file mode 100644 index 0000000..ca33704 --- /dev/null +++ b/output/EMEA_Prod/slo/TP_Mobile_RemoteServices.tf @@ -0,0 +1,61 @@ +module TP_Mobile_RemoteServices { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_RemoteServices" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </door-lock~", + ~"POST /api/v2/presentation/remote-commands//door-unlock~", + ~"POST /api/v2/presentation/remote-commands//climate-now~", + ~"POST /api/v2/presentation/remote-commands//vehicle-finder~", + ~"POST /api/v2/presentation/remote-commands//climate-timer~", + ~"POST /api/v2/presentation/remote-commands//light-flash~", + ~"POST /api/v2/presentation/remote-commands//charging-profile~", + ~"POST /api/v2/presentation/remote-commands/eventPosition~", + ~"GET /api/v1/presentation/remote-history/~", + ~"POST /api/v2/presentation/remote-commands/eventStatus~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-vehicle-remote-commands-composite-service - PROD~" + ) + ),entityName.in( + ~"POST /api/v2/presentation/remote-commands//door-lock~", + ~"POST /api/v2/presentation/remote-commands//door-unlock~", + ~"POST /api/v2/presentation/remote-commands//climate-now~", + ~"POST /api/v2/presentation/remote-commands//vehicle-finder~", + ~"POST /api/v2/presentation/remote-commands//climate-timer~", + ~"POST /api/v2/presentation/remote-commands//light-flash~", + ~"POST /api/v2/presentation/remote-commands//charging-profile~", + ~"POST /api/v2/presentation/remote-commands/eventPosition~", + ~"GET /api/v1/presentation/remote-history/~", + ~"POST /api/v2/presentation/remote-commands/eventStatus~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/EMEA_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf b/output/EMEA_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf new file mode 100644 index 0000000..1b9a970 --- /dev/null +++ b/output/EMEA_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf @@ -0,0 +1,34 @@ +module TP_Mobile_Send2VehicleLegacy { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Send2VehicleLegacy" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </state~", + ~"GET /v1/vehicle/~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-vehicle-composite-service - PROD~", + ~"VehicleService - PROD~" + ) + ),entityName.in( + ~"GET /api/v1/vehicles//state~", + ~"GET /v1/vehicle/~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/EMEA_Prod/slo/TP_Mobile_VehicleList.tf b/output/EMEA_Prod/slo/TP_Mobile_VehicleList.tf new file mode 100644 index 0000000..e220403 --- /dev/null +++ b/output/EMEA_Prod/slo/TP_Mobile_VehicleList.tf @@ -0,0 +1,45 @@ +module TP_Mobile_VehicleList { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_VehicleList" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </password~", + ~"GET /api/v1/digitalkey//pairing~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"TrackApi - smc - PROD~", + ~"digital-key-composite-service - PROD~" + ) + ),entityName.in( + ~"trackKey~", + ~"manageKey~", + ~"GET /api/v1/digitalkey//password~", + ~"GET /api/v1/digitalkey//pairing~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/NA_Prod/slo/TP_Mobile_Login.tf b/output/NA_Prod/slo/TP_Mobile_Login.tf new file mode 100644 index 0000000..266953a --- /dev/null +++ b/output/NA_Prod/slo/TP_Mobile_Login.tf @@ -0,0 +1,49 @@ +module TP_Mobile_Login { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Login" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </primary~", + ~"POST /api/v2/vehicles//primary/map~", + ~"POST /api/v1/vehicles//validate-security-code~", + ~"POST /api/v1/vehicles//resend-security-code~", + ~"DELETE /api/v1/vehicles/~", + ~"POST /api/v3/mappings/create~", + ~"POST /api/v3/mappings/continue~", + ~"POST /api/v3/mappings/validate-security-code~", + ~"POST /api/v3/mappings/resend-security-code~", + ~"GET /api/v3/images/~", + ~"DELETE /api/v3/mappings~", + ~"POST /api/v2/vehicles//secondary~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-user-composite-service - PROD~", + ~"vehicle-mapping-composite-service - PROD~" + ) + ),entityName.in( + ~"GET /api/v2/presentation/users/validate~", + ~"POST /api/v2/vehicles//primary~", + ~"POST /api/v2/vehicles//primary/map~", + ~"POST /api/v1/vehicles//validate-security-code~", + ~"POST /api/v1/vehicles//resend-security-code~", + ~"DELETE /api/v1/vehicles/~", + ~"POST /api/v3/mappings/create~", + ~"POST /api/v3/mappings/continue~", + ~"POST /api/v3/mappings/validate-security-code~", + ~"POST /api/v3/mappings/resend-security-code~", + ~"GET /api/v3/images/~", + ~"DELETE /api/v3/mappings~", + ~"POST /api/v2/vehicles//secondary~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/NA_Prod/slo/TP_Mobile_PersonalFavorites.tf b/output/NA_Prod/slo/TP_Mobile_PersonalFavorites.tf new file mode 100644 index 0000000..8660e6a --- /dev/null +++ b/output/NA_Prod/slo/TP_Mobile_PersonalFavorites.tf @@ -0,0 +1,55 @@ +module TP_Mobile_PersonalFavorites { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_PersonalFavorites" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = <~", + ~"PUT /api/v3/favorites/~", + ~"DELETE /api/v2/favorites/~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-destination-composite-service - PROD~" + ) + ),entityName.in( + ~"POST /api/v2/favorites/~", + ~"POST /api/v3/favorites/~", + ~"GET /api/v2/favorites/~", + ~"GET /api/v3/favorites/~", + ~"PUT /api/v2/favorites/~", + ~"PUT /api/v3/favorites/~", + ~"DELETE /api/v2/favorites/~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/NA_Prod/slo/TP_Mobile_Remote360.tf b/output/NA_Prod/slo/TP_Mobile_Remote360.tf new file mode 100644 index 0000000..0d44337 --- /dev/null +++ b/output/NA_Prod/slo/TP_Mobile_Remote360.tf @@ -0,0 +1,57 @@ +module TP_Mobile_Remote360 { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Remote360" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = <~", + ~"POST /api/v1/download/[UUID]//confirm~", + ~"GET /api/v1/vehicle//egomodelurl~", + ~"GET /api/v1/vehicle//key~", + ~"GET /api/v1/recordings/vehicle/~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"remote-360-composite-service - PROD~" + ) + ),entityName.in( + ~"GET /api/v1/events/[UUID]~", + ~"POST /api/v1/events/[UUID]/cancel~", + ~"POST /api/v1/event/execute~", + ~"GET /api/v1/download/[UUID]/~", + ~"POST /api/v1/download/[UUID]//confirm~", + ~"GET /api/v1/vehicle//egomodelurl~", + ~"GET /api/v1/vehicle//key~", + ~"GET /api/v1/recordings/vehicle/~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/NA_Prod/slo/TP_Mobile_RemoteServices.tf b/output/NA_Prod/slo/TP_Mobile_RemoteServices.tf new file mode 100644 index 0000000..fdbde69 --- /dev/null +++ b/output/NA_Prod/slo/TP_Mobile_RemoteServices.tf @@ -0,0 +1,67 @@ +module TP_Mobile_RemoteServices { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_RemoteServices" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = </door-lock~", + ~"POST /api/v2/presentation/remote-commands//door-unlock~", + ~"POST /api/v2/presentation/remote-commands//climate-now~", + ~"POST /api/v2/presentation/remote-commands//vehicle-finder~", + ~"POST /api/v2/presentation/remote-commands//climate-timer~", + ~"POST /api/v2/presentation/remote-commands//light-flash~", + ~"POST /api/v3/presentation/remote-commands//horn-blow~", + ~"POST /api/v2/presentation/remote-commands//horn-blow~", + ~"POST /api/v2/presentation/remote-commands//charging-profile~", + ~"POST /api/v2/presentation/remote-commands/eventPosition~", + ~"GET /api/v1/presentation/remote-history/~", + ~"GET /api/v2/presentation/remote-history/~", + ~"POST /api/v2/presentation/remote-commands/eventStatus~" + )"))))):splitBy()) + / + (builtin:service.keyRequest.count.server:filter(and(or(in("dt.entity.service_method",entitySelector("type(service_method), + fromRelationship.isServiceMethodOfService( + type(~"SERVICE~"),entityName.in( + ~"btc-vehicle-remote-commands-composite-service - PROD~" + ) + ),entityName.in( + ~"POST /api/v2/presentation/remote-commands//door-lock~", + ~"POST /api/v2/presentation/remote-commands//door-unlock~", + ~"POST /api/v2/presentation/remote-commands//climate-now~", + ~"POST /api/v2/presentation/remote-commands//vehicle-finder~", + ~"POST /api/v2/presentation/remote-commands//climate-timer~", + ~"POST /api/v2/presentation/remote-commands//light-flash~", + ~"POST /api/v3/presentation/remote-commands//horn-blow~", + ~"POST /api/v2/presentation/remote-commands//horn-blow~", + ~"POST /api/v2/presentation/remote-commands//charging-profile~", + ~"POST /api/v2/presentation/remote-commands/eventPosition~", + ~"GET /api/v1/presentation/remote-history/~", + ~"GET /api/v2/presentation/remote-history/~", + ~"POST /api/v2/presentation/remote-commands/eventStatus~" + )"))))):splitBy())) + EOT + + # if not set (removed) it's defaulted to "-1d" + timeframe = "-1d" + + # currently the only possible value + evaluation = "AGGREGATE" + + # target and warning percentage of the SLO as double + target = 98 # if not set(removed) it's defaulted to 98 + warning = 99 # if not set(removed) it's defaulted to 99 + +} \ No newline at end of file diff --git a/output/NA_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf b/output/NA_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf new file mode 100644 index 0000000..1b9a970 --- /dev/null +++ b/output/NA_Prod/slo/TP_Mobile_Send2VehicleLegacy.tf @@ -0,0 +1,34 @@ +module TP_Mobile_Send2VehicleLegacy { + + source = "../../_dynatrace-base-modules/dynatrace-service-level-objective" + + name = "TP_Mobile_Send2VehicleLegacy" + + description = "2.0 SLO Mobile" + + # entity selector object + filter = "" + + # metric expression of the calculation as done in data explorer ui + metric_expression = <