-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·69 lines (60 loc) · 1.67 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·69 lines (60 loc) · 1.67 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
#!/bin/bash
BASE_URL="http://localhost:3001"
echo "🧪 Resource Orchestrator API Test Script"
echo "========================================"
echo ""
echo "📋 1. Getting provider info..."
echo "GET $BASE_URL/provider/info"
echo ""
curl -s "$BASE_URL/provider/info" | jq '.'
echo ""
echo "---"
echo ""
echo "🚀 2. Provisioning a new resource..."
echo "POST $BASE_URL/v1/resources"
echo ""
RESPONSE=$(curl -s -X POST "$BASE_URL/v1/resources" \
-H "Content-Type: application/json" \
-d '{
"resourceId": "res_test_001",
"typeId": "example-resource",
"configuration": {
"resourceName": "my-test-resource",
"size": "medium"
},
"metadata": {
"organisationName": "test-org",
"projectName": "test-project"
}
}')
echo "$RESPONSE" | jq '.'
ORCHESTRATOR_ID=$(echo "$RESPONSE" | jq -r '.orchestratorResourceId')
echo ""
echo "✅ Created resource with ID: $ORCHESTRATOR_ID"
echo ""
echo "---"
echo ""
echo "📊 3. Getting resource status..."
echo "GET $BASE_URL/v1/resources/$ORCHESTRATOR_ID"
echo ""
curl -s "$BASE_URL/v1/resources/$ORCHESTRATOR_ID" | jq '.'
echo ""
echo "---"
echo ""
echo "📈 4. Getting resource metrics..."
echo "GET $BASE_URL/v1/resources/$ORCHESTRATOR_ID/metrics?period=24h"
echo ""
curl -s "$BASE_URL/v1/resources/$ORCHESTRATOR_ID/metrics?period=24h" | jq '.'
echo ""
echo "---"
echo ""
echo "🗑️ 5. Deprovisioning resource..."
echo "DELETE $BASE_URL/v1/resources/$ORCHESTRATOR_ID"
echo ""
curl -s -X DELETE "$BASE_URL/v1/resources/$ORCHESTRATOR_ID" | jq '.'
echo ""
echo "---"
echo ""
echo "✅ Test completed!"
echo ""
echo "💡 Tip: Change scripts folder in config.json to './examples/git-repo' to test Git implementation"