diff options
author | 2018-01-28 23:58:35 -0500 | |
---|---|---|
committer | 2018-01-29 00:00:22 -0500 | |
commit | 60be767cee1a22dfd3ad4fca29fedbe56a277bdc (patch) | |
tree | 987dd1177f11bd6bfcc38e3e0c9193f6be121587 /vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c | |
parent | 39f35cca6560c97ecd719a13793ead184f6e7e3c (diff) |
Function to modify event source name
Issue-ID: CERT-13
Change-Id: I7dc342bc7fcf99525958c32cd6c6c309344640fc
Signed-Off-by: Gokul SIngaraju <goksing@gmail.com>
Diffstat (limited to 'vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c')
-rw-r--r-- | vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c b/vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c index fceb893c..b8650745 100644 --- a/vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c +++ b/vnfs/VES5.0/evel/evel-library/code/evel_library/metadata.c @@ -309,6 +309,7 @@ exit_label: return rc; } + /**************************************************************************//** * Initialize default values for vm_name and vm_uuid - for testing purposes. *****************************************************************************/ @@ -341,6 +342,29 @@ void openstack_metadata_initialize() } /**************************************************************************//** + * Initialize value for vm_name for all coming events + * @param source_name Source name string. + * Must confirm with EVEL source name standard + * @returns Status code + * @retval EVEL_SUCCESS On success + * @retval ::EVEL_ERR_CODES On failure. + *****************************************************************************/ +EVEL_ERR_CODES evel_set_source_name(char * src_name) +{ + if( src_name && src_name[0] ) + { + if( strlen(src_name) < MAX_METADATA_STRING ){ + strcpy(vm_name,src_name); + return EVEL_SUCCESS; + } else + EVEL_DEBUG("Event Source Name too long"); + } + else + EVEL_DEBUG("Invalid Event Source Name string"); + return EVEL_ERR_GEN_FAIL; +} + +/**************************************************************************//** * Get a string value from supplied JSON by matching the key. * * As the structure of the metadata we're looking at is pretty straightforward |