package org.openbaton.nfvo.api;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by lto on 13/10/16.
 */
@RestController
@RequestMapping("/api/v1/version")
public class RestMain {

  @RequestMapping(method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
  public String getVersion() {
    return RestMain.class.getPackage().getImplementationVersion();
  }
}

@@ -41,38 +41,335 @@
 org.
-springframework.http.MediaType
+openbaton.exceptions.NotFoundException;%0Aimport org.openbaton.nfvo.security.interfaces.UserManagement;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.beans.factory.annotation.Value;%0Aimport org.springframework.http.MediaType;%0Aimport org.springframework.web.bind.annotation.RequestHeader
 ;%0Aim
@@ -639,14 +639,11 @@
 /v1/
-versio
+mai
 n%22)%0A
@@ -670,31 +670,229 @@
 n %7B%0A%0A  @
-RequestMapping(
+Value(%22$%7Bnfvo.rabbit.brokerIp%7D%22)%0A  private String nfvoIp;%0A%0A  @Value(%22$%7Bserver.port%7D%22)%0A  private String nfvoPort;%0A%0A  @Autowired private UserManagement userManagement;%0A%0A  @RequestMapping(%0A    value = %22version%22,%0A    
 method =
@@ -910,16 +910,20 @@
 hod.GET,
+%0A   
  produce
@@ -952,16 +952,19 @@
 IN_VALUE
+%0A  
 )%0A  publ
@@ -1058,11 +1058,1015 @@
 n();%0A  %7D
+%0A%0A  @RequestMapping(%0A    value = %22openbaton-rc%22,%0A    method = RequestMethod.GET,%0A    produces = MediaType.APPLICATION_OCTET_STREAM_VALUE%0A  )%0A  public String getOpenRCFile(@RequestHeader(%22project-id%22) String projectId)%0A      throws NotFoundException %7B%0A    return getOpenRcFile(projectId);%0A  %7D%0A%0A  private String getOpenRcFile(String projectId) throws NotFoundException %7B%0A    return %22#!/bin/bash%5Cn%22%0A        + %22%5Cn%22%0A        + %22unset OB_NFVO_IP%5Cn%22%0A        + %22unset OB_NFVO_PORT%5Cn%22%0A        + %22unset OB_PROJECT_ID%5Cn%22%0A        + %22unset OB_USERNAME%5Cn%22%0A        + %22unset OB_PASSWORD%5Cn%22%0A        + %22export OB_NFVO_IP=%22%0A        + nfvoIp%0A        + %22%5Cn%22%0A        + %22export OB_NFVO_PORT=%22%0A        + nfvoPort%0A        + %22%5Cn%22%0A        + %22export OB_PROJECT_ID=%22%0A        + projectId%0A        + %22%5Cn%22%0A        + %22export OB_USERNAME=%22%0A        + userManagement.getCurrentUser().getUsername()%0A        + %22%5Cn%22%0A        + %22echo -n Insert Open Baton Password: %5Cn%22%0A        + %22read -s password%5Cn%22%0A        + %22export OB_PASSWORD=$password%5Cn%22;%0A  %7D
 %0A%7D%0A

Add rest api for download openbatonrc file