<commit_before><commit_msg>PS-39 Added documentation for VirtualMachineTemplate<commit_after>﻿# VirtualMachineTemplate Actions
***

## Description

The VirtualMachineTemplate represents a template for creating virtual machines. It describes the resources need to start a virtual machine for the application component it is attached to.
***

## GET /api/virtualMachineTemplate

**Description** Returns a list of virtual machine templates supported by the system.

**Request Parameters** None

**Request Body** This operation does not require a request body.

**Response** A list of all virtual machine template entities stored in the database.

**Response Body Example**
```
[
   {
      "links":[
         {
            "href":"http://example.com:9000/api/virtualMachineTemplate/1",
            "rel":"self"
         }
      ],
      "cloud":1
      "cloudImage":1
      "cloudLocation":2
      "cloudHardware":3s
   }
]
```
**Normal Response Code** 200

**Error Response Code** 500 (server error), 403 (forbidden), 401 (unauthorized)
***
## GET /api/virtualMachineTemplate/{vmt_id}

**Description** Returns the virtual machine template identified by the given {vmt_id}.

**Request Parameters**

Parameter     | Description
------------- | -------------
vmt_id        | The id of the virtual machine template.

**Request Body** This operation does not require a request body.

**Response Body Example** Shows the selected virtual machine template entity.

```
{
  "links":[
     {
        "href":"http://example.com:9000/api/virtualMachineTemplate/1",
        "rel":"self"
     }s
  ],
  "cloud":1
  "cloudImage":1
  "cloudLocation":2
  "cloudHardware":3s
}
```

**Normal Response Code** 200

**Error Response Code** 500 (server error), 403 (forbidden), 401 (unauthorized), 404 (not found)
***
## POST /api/virtualMachineTemplate

**Description** Creates a new virtual machine template entity. The new entity will be returned.

**Request Parameters**

Parameter     | Description
------------- | ----------------------------------------------------------
cloud         | The cloud the virtual machine will be started in.
cloudImage    | The cloud image that will be used to start the machine.
cloudLocation | The cloud location that will be used to start the machine.
cloudHardware | The cloud hardware that will be used to start the machine.

**Request Body Example**
```
{
  "cloud":1
  "cloudImage":1
  "cloudLocation":2
  "cloudHardware":3
}
```
**Response** The created entity. See GET /api/virtualMachineTemplate/{vmt_id}

**Normal Response Code** 200

**Error Response Code** 500 (server error), 403 (forbidden), 401 (unauthorized), 400 (bad request)
***
## PUT /api/virtualMachineTemplate/{vmt_id}

**Description** Updates the virtual machine template identified by the given id.

**Request Parameters** 

Parameter     | Description
------------- | ----------------------------------------------------------
cloud         | The cloud the virtual machine will be started in.
cloudImage    | The cloud image that will be used to start the machine.
cloudLocation | The cloud location that will be used to start the machine.
cloudHardware | The cloud hardware that will be used to start the machine.

**Request Body Example**
```
{
  "cloud":1
  "cloudImage":1
  "cloudLocation":1
  "cloudHardware":1
}
```
**Response** The updated entity. See GET /api/virtualMachineTemplate/{vmt_id}

**Normal Response Code** 200

**Error Response Code** 500 (server error), 403 (forbidden), 401 (unauthorized), 404 (not found), 400 (bad request)
***
## DELETE /api/virtualMachineTemplate/{vmt_id}

**Description** Deletes the virtual machine template identified by the given {vmt_id}.

**Request Parameters** 

Parameter     | Description
------------- | -----------------------------------------------------
vmt_id        | The id of the virtual machine template to be deleted.

**Response** No data.

**Normal Response Code** 200

**Error Response Code** 500 (server error), 403 (forbidden), 401 (unauthorized), 404 (not found)
{'fraction_non_alphanumeric': 0.16417910447761194, 'fraction_numerical': 0.02562189054726368, 'mean_word_length': 3.0616161616161617, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1456412', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1027, 'n_words': 411}