Metadata-Version: 2.1
Name: RESTApi-prasanth
Version: 6.7.0.2
Summary: REST API Automation study
Home-page: https://github.com/Prasanthdemigod/REST_API
Author: Prasanth B
Author-email: bprashanth243@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

# RestApi Automation

Using RestApi to Automate the Test cases -> Backup, Restore

## Before Start

The Setup should be ready with Avamar server connected to vCenter and proxy registered with the Avamar Server.


## Installation

Python Version --> Preferably 3.5.0 and above.

Use the package manager [pip] if possible the latest Version.

```bash
apt-get install python-pip
```
#### Other Libraries

```bash pip install requests```  --> to  install the requests module

```bash pip install yaml```  --> For Yaml Configuration

```bash pip install logging``` --> For Log creation


## Usage

Fill the Config.yaml file for User Entries. Some of them are explained below,

Authorization : Authorization Token to access Avamar Server(Use Postman to retrieve one).<br/>
vCenterSessionId : Session Id of the vCenter server.<br/>
vmType : The type of VM whose backup has to be taken(Windows, Linux)<br/>
FolderPath : Folder where the VM is kept <br/>
NewVMName : While Restoring the New VM name <br/>


For Eg.

```Yaml

IP: 10.110.211.252
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiUk9PVCIsInVzZXJfbmFtZSI6Ik1DVXNlciIsInNjb3BlIjpbIndyaXRlIl0sImRvbWFpbiI6Ii8iLCJhdXRob3JpemVkX2RvbWFpbiI6Ii8iLCJleHAiOjE1NTI2NDc2NzksImF1dGhvcml0aWVzIjpbIlJPT1QiXSwianRpIjoiNjBlZTUyNWItZjBmYi00NTE2LWIyMTEtYmZiNThiMzQ3Y2E3IiwiY2xpZW50X2lkIjoiM2MwNDFiODctNTIyYi00NThlLTgwZmYtYjY5MTZiMmU5N2JmIn0.EpkFA2litAI_CigsTK1s3GYFmG6BP48_EOj-IIPXgNX5-SwpDlg32-MP8XgCbMYXOpPLRUzlPnIIBA8jANBVL9Tg3esF_u2qmKU7CMLVyJTIfZhB9x1NAoE5S0_6Fb8Z68PkbUWkUYc0ubaoGEhMzc775bLxU4g_ULUdtkQSGKYCTg2CLnmqhONZaWTw5M83Y-L8qZ7T4DvgEbkWtXHZ0jdnLcSiAXtv1qX3rEESk8LYVSuvoeLIPSnNK50vydh_H_cPTw9jfF_J8Qfa5mTAAfnuzTZBPGtyA2zodtOin1yyEOC1VPz7HpHU-0NMOKF1YCVleZXzV35BdNw-JxBfS1c92BMZQoF-yqyTf1Q5qwGCMA0lghxd0ClNwTM4YCCe-o3FBcVeCWLehL5MyGDuLk0JI8uGRJPR7XHpwpy8KTSF8L_9A-0i3xS0ZZQf9AxTDIEMIheEAF0VWgu3ulZ92Ud_9qThICTUWvqkHonuLiKs2FoPxrGfFyOeSeLlaZEO
vCenterSessionId: 4f99479faf19893b1dd86507b7fcfc7e
vCenter: 10.110.211.168
PolicyName: Gsan-Policy
PolicyDomain: /10.110.211.168/VirtualMachines
Content-Type: application/json
VM_id: c146dd0ebed42ff4cd94460ddeb509fb6cbdf7e7
vmType: Windows
VcCid: 14bda782e11827a1c69201a43ac0e3cc2b4a24a8
Datastore: datastore1
FolderPath: /AVE_A10N_DC/vm/Automation/
NewVMName: Restore-VM-2019_18
ResourcePoolPath: /AVE_A10N_DC/host/10.110.211.22/Resources/Compute-ResourcePool/
DatacenterName: AVE_A10N_DC


```

## Running

After filling the yaml file run the below command in the terminal,
```bash
python REST_Automation.py
```
Log file produced is

##  Contributing

All suggestions and trial are welcome.  


