
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.
curl -L -X GET 'https://anypoint.mulesoft.com/amc/application-manager/api/v2/organizations/<org ID>/environments/<environment>/deployments/<deployment ID>' \ -H 'Authorization: Bearer <bearer token>' \ --data-raw ''
{
"id": "9b5ba1ae-4f9f-4d6b-943e-44cf1db78dba",
"name": "mycpu",
"creationDate": 1646688513192,
"lastModifiedDate": 1646688513192,
"target": {
"provider": "MC",
"targetId": "5c769e40-c70b-4bf4-96bd-4351456f85ff",
"deploymentSettings": {
"jvm": {},
"anypointMonitoringScope": "cluster",
"sidecars": {
"anypoint-monitoring": {
"image": "auto",
"resources": {
"cpu": {
"limit": "50m",
"reserved": "0m"
},
"memory": {
"limit": "50Mi",
"reserved": "50Mi"
}
}
}
},
"updateStrategy": "rolling",
"runtimeVersion": "4.4.0:20220124-2",
"clustered": false,
"forwardSslSession": false,
"http": {
"inbound": {
"publicUrl": "www.kfroogle.com/mycpu",
"pathRewrite": null
}
},
"resources": {
"cpu": {
"limit": "1000m",
"reserved": "1000m"
},
"memory": {
"limit": "3000Mi",
"reserved": "3000Mi"
}
},
"lastMileSecurity": false,
"enforceDeployingReplicasAcrossNodes": false
},
"replicas": 1
},
"status": "APPLYING",
"application": {
"status": "NOT_RUNNING",
"desiredState": "STARTED",
"ref": {
"groupId": "d581a7bc-e6c4-475c-8711-a2653959a2f4",
"artifactId": "simple-http-listener",
"version": "1.0.31",
"packaging": "jar"
},
"configuration": {
"mule.agent.application.properties.service": {
"properties": {},
"applicationName": "mycpu"
}
}
},
"desiredVersion": "9e968276-f862-4b2c-a6ec-d256ffd66539",
"replicas": [
{
"state": "UNDEPLOYED",
"deploymentLocation": "5c769e40-c70b-4bf4-96bd-4351456f85ff",
"currentDeploymentVersion": "9e968276-f862-4b2c-a6ec-d256ffd66539",
"reason": ""
}
],
"lastSuccessfulVersion": null
}
#/bin/bash
#Please install jq first: https://stedolan.github.io/jq/download/
USER=""
PASS=""
output=$(curl -sX POST https://anypoint.mulesoft.com/accounts/login -H 'Content-Type: application/json' -d '{"username": "'"$USER"'", "password": "'"$PASS"'"}')
ACCESS_TOKEN=$(echo $output | jq -r .access_token)
org_id_output=$(curl -sX GET https://anypoint.mulesoft.com/accounts/api/me -H "Authorization: Bearer $ACCESS_TOKEN")
ORG_ID=$(echo $org_id_output | jq -r .user.organizationId)
env_id_output=$(curl -sX GET "https://anypoint.mulesoft.com/accounts/api/organizations/"$ORG_ID"/environments" -H "authorization: bearer $ACCESS_TOKEN")
ENV_IDS=$(echo $env_id_output | jq -r '.data[].id' )
myarr=(${ENV_IDS//,/})
RESULT='{'
for IA in "${myarr[@]}"
do
res_output=$(curl -sX GET "https://anypoint.mulesoft.com/amc/application-manager/api/v2/organizations/"$ORG_ID"/environments/"$IA"/deployments/" -H "authorization: bearer $ACCESS_TOKEN")
EC2=$(echo $res_output | jq -r '.items[].id')
borkstring=$(echo $EC2 | sed -e 's/\[ //g' -e 's/\ ]//g' -e 's/\,//g')
arr=( $borkstring )
if [ ${#arr} -gt 1 ]; then
RESULT1='{'
else
RESULT1=''
fi
for dep in "${arr[@]}"
do
url="https://anypoint.mulesoft.com/amc/application-manager/api/v2/organizations/"$ORG_ID"/environments/"$IA"/deployments/"
url+="${dep}"
mes_output=$(curl -s -X GET "$url" -H "authorization: bearer $ACCESS_TOKEN")
ECNAME=$(echo $mes_output | jq -r '.name')
ECRESOURCES=$(echo $mes_output | jq -r '.target.deploymentSettings.resources')
if [ ${#ECRESOURCES} -lt 5 ]; then
continue
fi
RESULT1+="\"$ECNAME\""
RESULT1+=":"
RESULT1+=" ${ECRESOURCES},"
done
if [ ${#RESULT1} -gt 2 ]; then
RESULT1=${RESULT1%?}
RESULT1+='}'
else
RESULT1+="[]"
fi
RESULT+="\"$IA\""
RESULT+=":"
RESULT+=" ${RESULT1},"
done
RESULT=${RESULT%?}
RESULT+='}'
echo ${RESULT} | jq
{
"57127dfd-282a-448e-b61b-048142c1b607": [],
"119874a5-acdb-46e3-8540-438ce9c02993": [],
"30441cf5-b36a-433e-8687-ef070eb54b09": {
"testapp": {
"cpu": {
"limit": "300m",
"reserved": "300m"
},
"memory": {
"limit": "3000Mi",
"reserved": "3000Mi"
}
}
},
"c97c8a4a-7ea1-4130-bfe8-2bbe38f71bb3": [],
"d57641e4-6297-4750-bd3f-7df0540d1888": [],
"c7895e44-650d-45ad-abc7-2ff6a9c84def": {
"mytestjvm1": {
"cpu": {
"limit": "1000m",
"reserved": "1000m"
},
"memory": {
"limit": "3000Mi",
"reserved": "3000Mi"
}
},
"https": {
"cpu": {
"limit": "1000m",
"reserved": "1000m"
},
"memory": {
"limit": "3000Mi",
"reserved": "3000Mi"
}
},
"testhi": {
"cpu": {
"limit": "1000m",
"reserved": "1000m"
},
"memory": {
"limit": "3000Mi",
"reserved": "3000Mi"
}
},
"mycpu": {
"cpu": {
"limit": "1000m",
"reserved": "1000m"
},
"memory": {
"limit": "3000Mi",
"reserved": "3000Mi"
}
},
"monday2": {
"cpu": {
"limit": "1000m",
"reserved": "1000m"
},
"memory": {
"limit": "3000Mi",
"reserved": "3000Mi"
}
}
},
"d5167780-46e2-44e8-b9aa-c9e6de0ec345": []
}
001115724