-
- //populate everything if needed
- for(int i = 0; i < manager_installed_function_types_count; i++) {
- char *xpath = 0;
-
- asprintf(&xpath, "%s[function-type='%s']/function-type", NTS_FUNCTION_LIST_SCHEMA_XPATH, manager_context[i].function_type_string);
- rc = sr_set_item_str(session_running, xpath, (const char *)manager_context[i].function_type_string, 0, 0);
- if(rc != SR_ERR_OK) {
- log_error("sr_set_item_str failed");
- return NTS_ERR_FAILED;
- }
- free(xpath);
-
- asprintf(&xpath, "%s[function-type='%s']/started-instances", NTS_FUNCTION_LIST_SCHEMA_XPATH, manager_context[i].function_type_string);
- rc = sr_set_item_str(session_running, xpath, "0", 0, 0);
- if(rc != SR_ERR_OK) {
- log_error("sr_set_item_str failed");
- return NTS_ERR_FAILED;
- }
- free(xpath);
-
- asprintf(&xpath, "%s[function-type='%s']/mounted-instances", NTS_FUNCTION_LIST_SCHEMA_XPATH, manager_context[i].function_type_string);
- rc = sr_set_item_str(session_running, xpath, "0", 0, 0);
- if(rc != SR_ERR_OK) {
- log_error("sr_set_item_str failed");
- return NTS_ERR_FAILED;
- }
- free(xpath);
-
- asprintf(&xpath, "%s[function-type='%s']/mount-point-addressing-method", NTS_FUNCTION_LIST_SCHEMA_XPATH, manager_context[i].function_type_string);
- rc = sr_set_item_str(session_running, xpath, (const char*)manager_context[i].mount_point_addressing_method, 0, 0);
- if(rc != SR_ERR_OK) {
- log_error("sr_set_item_str failed");
- return NTS_ERR_FAILED;
- }
- free(xpath);
-
- asprintf(&xpath, "%s[function-type='%s']/docker-instance-name", NTS_FUNCTION_LIST_SCHEMA_XPATH, manager_context[i].function_type_string);
- rc = sr_set_item_str(session_running, xpath, (const char*)manager_context[i].docker_instance_name, 0, 0);
- if(rc != SR_ERR_OK) {
- log_error("sr_set_item_str failed");
- return NTS_ERR_FAILED;
- }
- free(xpath);
-
- asprintf(&xpath, "%s[function-type='%s']/docker-version-tag", NTS_FUNCTION_LIST_SCHEMA_XPATH, manager_context[i].function_type_string);
- rc = sr_set_item_str(session_running, xpath, (const char*)manager_context[i].docker_version_tag, 0, 0);
- if(rc != SR_ERR_OK) {
- log_error("sr_set_item_str failed");
- return NTS_ERR_FAILED;
- }
- free(xpath);
-
- asprintf(&xpath, "%s[function-type='%s']/docker-repository", NTS_FUNCTION_LIST_SCHEMA_XPATH, manager_context[i].function_type_string);
- rc = sr_set_item_str(session_running, xpath, (const char*)manager_context[i].docker_repository, 0, 0);
- if(rc != SR_ERR_OK) {
- log_error("sr_set_item_str failed");
- return NTS_ERR_FAILED;
- }
- free(xpath);
- }
-
- char int_to_str[30];
-
- //setup sdn-controller defaults
- if(strlen(framework_environment.sdn_controller_ip)) {
- rc = sr_set_item_str(session_running, NTS_SDN_CONTROLLER_CONFIG_XPATH"/controller-ip", (const char*)framework_environment.sdn_controller_ip, 0, 0);
- if(rc != SR_ERR_OK) {
- log_error("sr_set_item_str failed");
- return NTS_ERR_FAILED;
- }
- }
-
- sprintf(int_to_str, "%d", framework_environment.sdn_controller_port);
- rc = sr_set_item_str(session_running, NTS_SDN_CONTROLLER_CONFIG_XPATH"/controller-port", (const char*)int_to_str, 0, 0);