aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/dcm/test/dcm_call_api.sh61
1 files changed, 19 insertions, 42 deletions
diff --git a/src/dcm/test/dcm_call_api.sh b/src/dcm/test/dcm_call_api.sh
index 966bc3d6..33fbf314 100755
--- a/src/dcm/test/dcm_call_api.sh
+++ b/src/dcm/test/dcm_call_api.sh
@@ -14,7 +14,6 @@
# * limitations under the License.
# */
-
dcm_addr="http://localhost:9077"
# parameters
@@ -22,6 +21,7 @@ project="test-project"
description="test-description"
logical_cloud_name="lc1"
namespace="ns1"
+api_groups=""
user="user-1"
permission="permission-1"
cluster_provider_name="cp-1"
@@ -52,7 +52,7 @@ logical_cloud_data="$(cat << EOF
"type" : "certificate",
"user-permissions" : [
{ "permission-name" : "${permission}",
- "apiGroups" : ["stable.example.com"],
+ "apiGroups" : ["${api_groups}"],
"resources" : ["secrets", "pods"],
"verbs" : ["get", "watch", "list", "create"]
}
@@ -99,8 +99,6 @@ cluster_2_data="$(cat << EOF
EOF
)"
-# removed all special chars from quota spec keys
-# due to loss of data when unmarshalling from json
quota_data="$(cat << EOF
{
"metadata" : {
@@ -108,54 +106,34 @@ quota_data="$(cat << EOF
"description": "${description}"
},
"spec" : {
- "persistentvolumeclaims" : "10",
- "pods": "500",
- "configmaps" : "10",
- "replicationcontrollers": "10",
- "resourcequotas" : "10",
- "services": "10",
- "secrets" : "10"
- }
-}
-EOF
-)"
-
-quota_data_original="$(cat << EOF
-{
- "metadata" : {
- "name" : "${quota_name}",
- "description": "${description}"
- },
- "spec" : {
"limits.cpu": "400",
"limits.memory": "1000Gi",
"requests.cpu": "300",
"requests.memory": "900Gi",
"requests.storage" : "500Gi",
- "requests.ephemeral-storage": "",
- "limits.ephemeral-storage": "",
- "persistentvolumeclaims" : " ",
+ "requests.ephemeral-storage": "500",
+ "limits.ephemeral-storage": "500",
+ "persistentvolumeclaims" : "500",
"pods": "500",
- "configmaps" : "",
- "replicationcontrollers": "",
- "resourcequotas" : "",
- "services": "",
- "services.loadbalancers" : "",
- "services.nodeports" : "",
- "secrets" : "",
- "count/replicationcontrollers" : "",
- "count/deployments.apps" : "",
- "count/replicasets.apps" : "",
- "count/statefulsets.apps" : "",
- "count/jobs.batch" : "",
- "count/cronjobs.batch" : "",
- "count/deployments.extensions" : ""
+ "configmaps" : "1000",
+ "replicationcontrollers": "500",
+ "resourcequotas" : "500",
+ "services": "500",
+ "services.loadbalancers" : "500",
+ "services.nodeports" : "500",
+ "secrets" : "500",
+ "count/replicationcontrollers" : "500",
+ "count/deployments.apps" : "500",
+ "count/replicasets.apps" : "500",
+ "count/statefulsets.apps" : "500",
+ "count/jobs.batch" : "500",
+ "count/cronjobs.batch" : "500",
+ "count/deployments.extensions" : "500"
}
}
EOF
)"
-
# Create logical cloud
printf "\n\nCreating logical cloud data\n\n"
curl -d "${logical_cloud_data}" -X POST ${logical_cloud_url}
@@ -169,7 +147,6 @@ curl -d "${cluster_2_data}" -X POST ${cluster_url}
printf "\n\nAdding resource quota for the logical cloud\n\n"
curl -d "${quota_data}" -X POST ${quota_url}
-
# Get logical cloud data
printf "\n\nGetting logical cloud\n\n"
curl -X GET "${logical_cloud_url}/${logical_cloud_name}"