{
	"variables": [],
	"info": {
		"name": "Nuage-REST-API",
		"_postman_id": "9b147593-dfc8-a8b4-9f6e-ad78d14a4317",
		"description": "",
		"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
	},
	"item": [
		{
			"name": "0_Basic_Auth",
			"event": [
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"exec": [
							"var jsonData = JSON.parse(responseBody);\r",
							"postman.setGlobalVariable(\"APIKey\", jsonData[0].APIKey);\r",
							""
						]
					}
				}
			],
			"request": {
				"url": "https://{{VSD_IP}}:{{VSD_PORT}}/nuage/api/v4_0/me",
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"description": ""
					},
					{
						"key": "X-Nuage-Organization",
						"value": "{{VSD_ENTERPRISE}}",
						"description": ""
					},
					{
						"key": "Authorization",
						"value": "Basic Y3Nwcm9vdDpjc3Byb290",
						"description": ""
					}
				],
				"body": {},
				"description": "This is basic authenticaiton to Nuage, with APIKey as token response"
			},
			"response": []
		},
		{
			"name": "1_Get_Enterprises",
			"request": {
				"url": "https://{{VSD_IP}}:{{VSD_PORT}}/nuage/api/v4_0/enterprises",
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"description": ""
					},
					{
						"key": "X-Nuage-Organization",
						"value": "{{VSD_ENTERPRISE}}",
						"description": ""
					},
					{
						"key": "Authorization",
						"value": "Basic Y3Nwcm9vdDpjc3Byb290",
						"description": ""
					}
				],
				"body": {},
				"description": "Update auth with APIKey from Basic_Auth"
			},
			"response": []
		},
		{
			"name": "2_Create_Enterprise",
			"request": {
				"url": "https://{{VSD_IP}}:{{VSD_PORT}}/nuage/api/v4_0/enterprises",
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"description": ""
					},
					{
						"key": "X-Nuage-Organization",
						"value": "{{VSD_ENTERPRISE}}",
						"description": ""
					},
					{
						"key": "Authorization",
						"value": "Basic Y3Nwcm9vdDo0NzI0ZWYwYi0xZjM3LTQ4MTctOTQxZC03NmEzMDAxZGMyZjc=",
						"description": ""
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\"name\":\"Postman_Enterprise\"}"
				},
				"description": "This will create \"Postman_Enterprise\""
			},
			"response": []
		},
		{
			"name": "3_Get_Enterprises_find_ID_with_script",
			"event": [
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"exec": [
							"var jsonData = JSON.parse(responseBody);\r",
							"var arrayLength = jsonData.length;\r",
							"for (var i = 0; i < arrayLength; i++) {\r",
							"    if( jsonData[i].name === \"Postman_Enterprise\" ){\r",
							"        postman.setGlobalVariable(jsonData[i].name, jsonData[i].ID);\r",
							"    }\r",
							"}"
						]
					}
				}
			],
			"request": {
				"url": "https://{{VSD_IP}}:{{VSD_PORT}}/nuage/api/v4_0/enterprises",
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"description": ""
					},
					{
						"key": "X-Nuage-Organization",
						"value": "{{VSD_ENTERPRISE}}",
						"description": ""
					},
					{
						"key": "Authorization",
						"value": "Basic Y3Nwcm9vdDo0NzI0ZWYwYi0xZjM3LTQ4MTctOTQxZC03NmEzMDAxZGMyZjc=",
						"description": ""
					}
				],
				"body": {},
				"description": "Update auth with APIKey from Basic_Auth"
			},
			"response": []
		},
		{
			"name": "4_DELETE_found_ID_from_previous",
			"request": {
				"url": "https://{{VSD_IP}}:{{VSD_PORT}}/nuage/api/v4_0/enterprises/{{Postman_Enterprise}}/?responseChoice=1",
				"method": "DELETE",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"description": ""
					},
					{
						"key": "X-Nuage-Organization",
						"value": "{{VSD_ENTERPRISE}}",
						"description": ""
					},
					{
						"key": "Authorization",
						"value": "Basic Y3Nwcm9vdDo0NzI0ZWYwYi0xZjM3LTQ4MTctOTQxZC03NmEzMDAxZGMyZjc=",
						"description": ""
					}
				],
				"body": {},
				"description": "Update auth with APIKey from Basic_Auth"
			},
			"response": []
		}
	]
}