<commit_before>  <img src="https://raw.githubusercontent.com/openbaton/openbaton.github.io/master/images/openBaton.png" width="250"/>
  
  Copyright © 2015-2016 [Open Baton](http://openbaton.org). 
  Licensed under [Apache v2 License](http://www.apache.org/licenses/LICENSE-2.0).

# Open Baton Client

Open Baton Client contains the Open Baton SDK and the Open Baton command-line interface. The SDK provides methods to access the RESTful NFVO API. The command-line interface enables you to use the OpenBaton SDK via the command-line. 

## Project Structure
The project contains the two modules *cli* and *sdk*. 

## How to install the Open Baton Client

Git clone this project. Navigate into the root directory of the project and execute *./gradlew build*.

## How to use the command-line interface

  
## Documentation
 * [Command-line interface][cli-documentation]
 * [SDK][sdk-documentation]

### Set the required environment variables
Navigate into the project's root directory and execute *source nfvo.properties*. A dialog appears and will ask you for some properties. 

### Openbaton command-line usage
    
    run a command: openbaton.sh command-name [arg-1] [arg-2] [arg-3]
    show the configuration: openbaton.sh -c
    activate debug mode: openbaton.sh -d command-name [arg-1] [arg-2] [arg-3]
    print help: openbaton.sh -h
    print help for a command: openbaton.sh command-name help
    list the available commands: openbaton.sh -l
    

### For help on a specific openbaton command, enter:
```sh
 $ openbaton.sh COMMAND help
```

### **Vim Instance Subcommands**
* **create**
  * Create the object of type Vim Instance
  ```sh
   $ openbaton.sh VimInstance-create file.json
  ```

* **delete**
  * Delete the object of type Vim Instance passing the id
  ```sh
   $ openbaton.sh VimInstance-delete id-vim-instance
  ```

* **update**
  * Update the object of type Vim nstance passing the new object and the id of the old object
  ```sh
   $ openbaton.sh VimInstance-update file.json id-vim-instance
  ```

* **findAll**
  * Find all the objects of type Vim Instance
  ```sh
   $ openbaton.sh VimInstance-findAll
  ```

* **findById**
  * Find the object of type Vim Instance through the id
  ```sh
   $ openbaton.sh VimInstance-findById id-vim-instance
  ```

### **Network Service Descriptor Subcommands**
* **create**
  * Create the object of type Network Service Descriptor
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-create file.json
  ```

* **delete**
  * Delete the object of type Network Service Descriptor passing the id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-delete id-network-service-descriptor
  ```

* **findAll**
  * Find all the objects of type Network Service Descriptor
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-findAll
  ```

* **findById**
  * Find the object of type Network Service Descriptor through the id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-findById id-network-service-descriptor
  ```

* **createVNFDependency**                                   
  * Create the Virtual Network Function Descriptor dependency for a Network Service Descriptor with a specific id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-createVNFDependency id-network-service-descriptor file.json
  ```
  The file should look similar to this:
  ```json
  {"parameters":["theParameter"], "version":1, 
  "source":{"id":"950811b6-ebb6-4a17-bf4e-ab61974acbc8"}, 
  "target": {"id":"9873ad54-2963-424d-ab5d-39403a5dd544"}
  }
  ```
  The ids belong to the particular VirtualNettworkFunctionDescriptor.

* **deleteVNFDependency**                                   
  * Delete the Virtual Network Function Descriptor dependency of a Network Service Descriptor with specific id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-deleteVNFDependency id-network-service-descriptor id-vnfdependency
  ```

* **getVNFDependencies**                                  
  * Get all the Virtual Network Function Descriptor Dependency of a Network Service Descriptor with specific id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-getVNFDependencies id-network-service-descriptor
  ```

* **getVNFDependency**                                      
  * Get the VirtualNetwork Function Descriptor dependency with specific id of a Network Service Descriptor with specific id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-getVNFDependency id-network-service-descriptor id-vnfdependency
  ```
  
* **getVirtualNetworkFunctionDescriptors**
  * Find all the objects of type VirtualNetworkFunctionDescriptor
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-getVirtualNetworkFunctionDescriptors id-network-service-descriptor
  ```
* **getVirtualNetworkFunctionDescriptor**
  * Find the object of type VirtualNetworkFunctionDescriptor through the id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-getVirtualNetworkFunctionDescriptor id-network-service-descriptor id-vnfd
  ```
      
### **Virtual Network Function Descriptor Subcommands**
* **create**
  * Create the object of type Virtual Network Function Descriptor
  ```sh
   $ openbaton.sh VirtualNetworkFunctionDescriptor-create file.json
  ```

* **delete**
  * Delete the object of type Virtual Network Function Descriptor passing the id
  ```sh
   $ openbaton.sh VirtualNetworkFunctionDescriptor-delete id-virtual-network-function-descriptor
  ```

* **findAll**
  * Find all the objects of type Virtual Network Function Descriptor
  ```sh
   $ openbaton.sh VirtualNetworkFunctionDescriptor-findAll
  ```

* **findById**
  * Find the object of type Virtual Network Function Descriptor through the id
  ```sh
   $ openbaton.sh VirtualNetworkFunctionDescriptor-findById id-virtual-network-function-descriptor
  ```

### **Network Service Record Subcommands**
* **create**
 
  * Create a Network Service Record from a Network Service Descriptor stored in the orchestrator
  ```sh
   $ openbaton.sh NetworkServiceRecord-create id-network-service-descriptor vim-map-file keypair-file configurations-file
  ```

The three arguments after the NSD id can be used to specify the VIM on which a VDU should be deployed, the keypairs that shall be used to deploy the NSR and configuration parameters for the VNFRs.  
If you want to specify the VIM to use for a particular VDU you can pass a file containing a map like this:
  ```json
   {"vdu1Name":[vim1,vim2,vim3], "vdu2Name":[vim1]}
  ```

In this case the VDU named vdu2Name would be deployed on vim1 and the VDU named vdu1Name randomly on one of the VIMs vim1, vim2 or vim3.  
<commit_msg>Fix: Fix mistake in json example<commit_after>  <img src="https://raw.githubusercontent.com/openbaton/openbaton.github.io/master/images/openBaton.png" width="250"/>
  
  Copyright © 2015-2016 [Open Baton](http://openbaton.org). 
  Licensed under [Apache v2 License](http://www.apache.org/licenses/LICENSE-2.0).

# Open Baton Client

Open Baton Client contains the Open Baton SDK and the Open Baton command-line interface. The SDK provides methods to access the RESTful NFVO API. The command-line interface enables you to use the OpenBaton SDK via the command-line. 

## Project Structure
The project contains the two modules *cli* and *sdk*. 

## How to install the Open Baton Client

Git clone this project. Navigate into the root directory of the project and execute *./gradlew build*.

## How to use the command-line interface

  
## Documentation
 * [Command-line interface][cli-documentation]
 * [SDK][sdk-documentation]

### Set the required environment variables
Navigate into the project's root directory and execute *source nfvo.properties*. A dialog appears and will ask you for some properties. 

### Openbaton command-line usage
    
    run a command: openbaton.sh command-name [arg-1] [arg-2] [arg-3]
    show the configuration: openbaton.sh -c
    activate debug mode: openbaton.sh -d command-name [arg-1] [arg-2] [arg-3]
    print help: openbaton.sh -h
    print help for a command: openbaton.sh command-name help
    list the available commands: openbaton.sh -l
    

### For help on a specific openbaton command, enter:
```sh
 $ openbaton.sh COMMAND help
```

### **Vim Instance Subcommands**
* **create**
  * Create the object of type Vim Instance
  ```sh
   $ openbaton.sh VimInstance-create file.json
  ```

* **delete**
  * Delete the object of type Vim Instance passing the id
  ```sh
   $ openbaton.sh VimInstance-delete id-vim-instance
  ```

* **update**
  * Update the object of type Vim nstance passing the new object and the id of the old object
  ```sh
   $ openbaton.sh VimInstance-update file.json id-vim-instance
  ```

* **findAll**
  * Find all the objects of type Vim Instance
  ```sh
   $ openbaton.sh VimInstance-findAll
  ```

* **findById**
  * Find the object of type Vim Instance through the id
  ```sh
   $ openbaton.sh VimInstance-findById id-vim-instance
  ```

### **Network Service Descriptor Subcommands**
* **create**
  * Create the object of type Network Service Descriptor
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-create file.json
  ```

* **delete**
  * Delete the object of type Network Service Descriptor passing the id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-delete id-network-service-descriptor
  ```

* **findAll**
  * Find all the objects of type Network Service Descriptor
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-findAll
  ```

* **findById**
  * Find the object of type Network Service Descriptor through the id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-findById id-network-service-descriptor
  ```

* **createVNFDependency**                                   
  * Create the Virtual Network Function Descriptor dependency for a Network Service Descriptor with a specific id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-createVNFDependency id-network-service-descriptor file.json
  ```
  The file should look similar to this:
  ```json
  {"parameters":["theParameter"], "version":1, 
  "source":{"id":"950811b6-ebb6-4a17-bf4e-ab61974acbc8"}, 
  "target": {"id":"9873ad54-2963-424d-ab5d-39403a5dd544"}
  }
  ```
  The ids belong to the particular VirtualNettworkFunctionDescriptor.

* **deleteVNFDependency**                                   
  * Delete the Virtual Network Function Descriptor dependency of a Network Service Descriptor with specific id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-deleteVNFDependency id-network-service-descriptor id-vnfdependency
  ```

* **getVNFDependencies**                                  
  * Get all the Virtual Network Function Descriptor Dependency of a Network Service Descriptor with specific id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-getVNFDependencies id-network-service-descriptor
  ```

* **getVNFDependency**                                      
  * Get the VirtualNetwork Function Descriptor dependency with specific id of a Network Service Descriptor with specific id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-getVNFDependency id-network-service-descriptor id-vnfdependency
  ```
  
* **getVirtualNetworkFunctionDescriptors**
  * Find all the objects of type VirtualNetworkFunctionDescriptor
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-getVirtualNetworkFunctionDescriptors id-network-service-descriptor
  ```
* **getVirtualNetworkFunctionDescriptor**
  * Find the object of type VirtualNetworkFunctionDescriptor through the id
  ```sh
   $ openbaton.sh NetworkServiceDescriptor-getVirtualNetworkFunctionDescriptor id-network-service-descriptor id-vnfd
  ```
      
### **Virtual Network Function Descriptor Subcommands**
* **create**
  * Create the object of type Virtual Network Function Descriptor
  ```sh
   $ openbaton.sh VirtualNetworkFunctionDescriptor-create file.json
  ```

* **delete**
  * Delete the object of type Virtual Network Function Descriptor passing the id
  ```sh
   $ openbaton.sh VirtualNetworkFunctionDescriptor-delete id-virtual-network-function-descriptor
  ```

* **findAll**
  * Find all the objects of type Virtual Network Function Descriptor
  ```sh
   $ openbaton.sh VirtualNetworkFunctionDescriptor-findAll
  ```

* **findById**
  * Find the object of type Virtual Network Function Descriptor through the id
  ```sh
   $ openbaton.sh VirtualNetworkFunctionDescriptor-findById id-virtual-network-function-descriptor
  ```

### **Network Service Record Subcommands**
* **create**
 
  * Create a Network Service Record from a Network Service Descriptor stored in the orchestrator
  ```sh
   $ openbaton.sh NetworkServiceRecord-create id-network-service-descriptor vim-map-file keypair-file configurations-file
  ```

The three arguments after the NSD id can be used to specify the VIM on which a VDU should be deployed, the keypairs that shall be used to deploy the NSR and configuration parameters for the VNFRs.  
If you want to specify the VIM to use for a particular VDU you can pass a file containing a map like this:
  ```json
   {"vdu1Name":["vim1","vim2","vim3"], "vdu2Name":["vim1"]}
  ```

In this case the VDU named vdu2Name would be deployed on vim1 and the VDU named vdu1Name randomly on one of the VIMs vim1, vim2 or vim3.  

{'fraction_non_alphanumeric': 0.09394795085095016, 'fraction_numerical': 0.011295123254216591, 'mean_word_length': 3.8389955686853767, 'pattern_counts': {'":': 16, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4452768', 'n_tokens_mistral': 3772, 'n_tokens_neox': 3639, 'n_words': 1281}