-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvm-checkrunning.json
More file actions
155 lines (155 loc) · 3.33 KB
/
Copy pathvm-checkrunning.json
File metadata and controls
155 lines (155 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
{
"info": {
"_postman_id": "7e7687d1-5f07-4b70-974b-b11994da4ec6",
"name": "2. Check VM",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Create AAD",
"event": [
{
"listen": "test",
"script": {
"id": "7b1b49f9-bd4e-429c-be15-37b3dce38f5a",
"exec": [
"// Retrieve access_token and set PM environment variable for all subsequent request",
"pm.test(\"Successful POST request\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([200]);",
"})",
"var json = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"bearerToken\", json.access_token);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "text"
},
{
"key": "client_id",
"value": "{{clientId}}",
"type": "text"
},
{
"key": "client_secret",
"value": "{{clientSecret}}",
"type": "text"
},
{
"key": "resource",
"value": "{{resource}}",
"type": "text"
}
]
},
"url": {
"raw": "https://login.microsoftonline.com/{{tenantId}}/oauth2/token",
"protocol": "https",
"host": [
"login",
"microsoftonline",
"com"
],
"path": [
"{{tenantId}}",
"oauth2",
"token"
]
}
},
"response": []
},
{
"name": "View Instance",
"event": [
{
"listen": "test",
"script": {
"id": "4ef70b6f-ed7c-49cd-97c3-c04b5f2768a7",
"exec": [
"pm.test(\"Successful POST request\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([200]);",
"})",
"",
"pm.test(\"Check Agent is running?\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.vmAgent.statuses[0].message).to.eql(\"Guest Agent is running\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{bearerToken}}",
"type": "text"
}
],
"url": {
"raw": "https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.Compute/virtualMachines/{{vmName}}/InstanceView?api-version=2017-12-01",
"protocol": "https",
"host": [
"management",
"azure",
"com"
],
"path": [
"subscriptions",
"{{subscriptionId}}",
"resourceGroups",
"{{resourceGroupName}}",
"providers",
"Microsoft.Compute",
"virtualMachines",
"{{vmName}}",
"InstanceView"
],
"query": [
{
"key": "api-version",
"value": "2017-12-01"
}
]
}
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "08b7cb21-27bd-4408-8962-ed7cc7f8d3c9",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "4378b55e-6597-4a38-a13e-f5ddf4c708a8",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"protocolProfileBehavior": {}
}