lib/sles4sap/sap_deployment_automation_framework/naming_conventions.pm

SYNOPSIS

Library contains functions that handle SDAF naming conventions used in various strings. Mostly used for generating resource names, file names or file paths. Please try not to add here complex functions that do much beyond returning a string.

%sdaf_region_matrix

SDAF uses own internal 4 character abbreviations for Public Cloud region names.

This is an internal matrix used for translation. It contains only commonly used regions, if you need to extend the list you can find definitions in the function get_region_code located in sdaf shell script at: https://github.com/Azure/sap-automation/blob/3c5d0d882f5892ae2159e262062e29c2b3fe59d9/deploy/scripts/deploy_utils.sh#L403

convert_region_to_long

convert_region_to_long($sdaf_region_code);

Performs region name conversion from 4 letter SDAF abbreviation to full region name. You can find definitions in the function get_region_code located in sdaf shell script:

https://github.com/Azure/sap-automation/blob/3c5d0d882f5892ae2159e262062e29c2b3fe59d9/deploy/scripts/deploy_utils.sh#L403

convert_region_to_short

convert_region_to_short($region);

Performs region name conversion from full region name to 4 letter SDAF abbreviation. You can find definitions in the function get_region_code located in sdaf shell script:

https://github.com/Azure/sap-automation/blob/3c5d0d882f5892ae2159e262062e29c2b3fe59d9/deploy/scripts/deploy_utils.sh#L403

homedir

homedir();

Returns home directory path for current user from env variable $HOME.

deployment_dir

deployment_dir([create=>1]);

Returns deployment directory path with job ID appended as unique identifier. Optionally it can create directory if it does not exists.

log_dir

log_dir([create=>1]);

Returns logging directory path with job ID appended as unique identifier. Optionally creates the directory.

sdaf_scripts_dir

sdaf_scripts_dir();

Returns directory containing SDAF scripts.

env_variable_file

env_variable_file();

Returns full path to a file containing all required SDAF OS env variables. Sourcing this file is essential for running SDAF.

get_sdaf_config_path

get_sdaf_config_path(
    deployment_type=>$deployment_type,
    env_code=>$env_code,
    sdaf_region_code=>$sdaf_region_code,
    [vnet_code=>$vnet_code,
    sap_sid=>$sap_sid,
    job_id=>$job_id]);

Returns path to config root directory for deployment type specified. Root config directory is deployment type specific and usually contains tfvar file, inventory file, SUT ssh keys, etc...

get_tfvars_path

get_tfvars_path(
    deployment_type=>$deployment_type,
    env_code=>$env_code,
    sdaf_region_code=>$sdaf_region_code,
    [vnet_code=>$vnet_code,
    sap_sid=>$sap_sid]);

Returns full tfvars filepath respective to deployment type.

generate_resource_group_name

generate_resource_group_name(deployment_type=>$deployment_type);

Returns name of the resource group for the deployment type specified by $deployment_type . Resource group pattern: SDAF-OpenQA-[deployment type]-[deployment id]-[OpenQA job id]

generate_deployer_name

generate_deployer_name([job_id=>$job_id]);

Generates resource name for deployer VM in format test_id-OpenQA_Deployer_VM.

get_workload_vnet_code

get_workload_vnet_code([job_id=>$job_id]);

Returns VNET code used for workload zone and sap systems resources. VNET code must be unique for each landscape, therefore it contains test ID as an identifier.