cloud:aws:servicediscovery
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| cloud:aws:servicediscovery [2018/11/08 13:50] – skipidar | cloud:aws:servicediscovery [2023/11/01 07:13] (current) – ↷ Page moved from business_process_management:camunda:cloud:aws:servicediscovery to cloud:aws:servicediscovery skipidar | ||
|---|---|---|---|
| Line 66: | Line 66: | ||
| # ping the service | # ping the service | ||
| echo -e " | echo -e " | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | Remove service | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | <sxh shell> | ||
| + | #/bin/bash -e | ||
| + | |||
| + | # Removes the services and the namespace, if no instances are available in the service anymore | ||
| + | |||
| + | |||
| + | #stop on error | ||
| + | #set -e | ||
| + | |||
| + | |||
| + | ######## ARGUMENTS | ||
| + | |||
| + | |||
| + | # retrieve the building ID: zurich-klinik | ||
| + | buildingName=${1? | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ########## SCRIPT START | ||
| + | |||
| + | |||
| + | dnsnamespace=" | ||
| + | servicename=" | ||
| + | |||
| + | |||
| + | |||
| + | # get the instance id by service | ||
| + | serviceId=$(aws servicediscovery list-services --query " | ||
| + | echo " | ||
| + | |||
| + | # get the instace id by service | ||
| + | instanceId=$(aws servicediscovery list-instances --service-id $serviceId --query " | ||
| + | echo " | ||
| + | |||
| + | # retrieve the namespace id | ||
| + | namespaceId=$(aws servicediscovery list-namespaces --query " | ||
| + | echo " | ||
| + | |||
| + | # deregister the instance | ||
| + | aws servicediscovery deregister-instance --service-id $serviceId --instance-id $instanceId | ||
| + | |||
| + | # deregister the service, will only work if no instances are left | ||
| + | aws servicediscovery delete-service --id $serviceId | ||
| + | |||
| + | # deregister the namespace, will only work if no services | ||
| + | aws servicediscovery delete-namespace --id $namespaceId | ||
| + | |||
| + | |||
| + | |||
| + | # ping the service | ||
| + | echo -e " | ||
| </ | </ | ||
cloud/aws/servicediscovery.1541685005.txt.gz · Last modified: (external edit)
