Giter Club home page Giter Club logo

Comments (1)

thiagogomesverissimo avatar thiagogomesverissimo commented on September 12, 2024

Exemplos da doc:

#!/bin/bash

# Set command paths.
ECHO=/bin/echo

# Make sure that the parameters are specified.
if [ -z "$1" ]; then
  $ECHO "Usage: $0 <hostname>"
  exit 1
fi

# Get arguments
url=$1

read -p "Test hosting_services resources for $url? (Y/n)" -n 1
if [[ $REPLY =~ ^[Yy]$ ]]
then
  echo -e "\nBegin test of $url\n"
  #-------------------------
  # Test Platform Operations
  #-------------------------
  echo -e "\nTesting platform operations\n"
  echo -e "---------------------------\n"

  echo -e "\nList second, third and fourth platforms\n\n"
  curl -i -X GET -d "http://$url/hosting_platform?row_count=3&offset=1"

# Site test example: curl -i -X POST -d "url=test3.sfyn.office.koumbit.net&data[platform]=619&data[profile]=51&data[client]=851" "http://$url/hosting_site"

  #-----------------------
  # Test Client Operations
  #-----------------------
  echo -e "\nTesting client operations\n"
  echo -e "-------------------------\n"

  echo -e "\nCreate client named Popo\n\n"
  curl -i -X POST -d "name=Popo" "http://$url/hosting_client"

  echo -e "\nRetrieve client named Popo\n\n"
  curl -i -X GET "http://$url/hosting_client/popo.json"

  echo -e "\nChange client Popo's name to Coconut\n\n"
  curl -i -X PUT -d "data[title]=Coconut" "http://$url/hosting_client/popo"

  echo -e "\nRetrieve all sites for client Coconut\n\n"
  curl -i -X POST -d "nid=coconut" "http://$url/hosting_client/sites"

  echo -e "\nDisable all sites for client Coconut\n\n"
  curl -i -X POST -d "nid=coconut" "http://$url/hosting_client/disable_sites"

  echo -e "\nEnable all sites for client Coconut\n\n"
  curl -i -X POST -d "nid=coconut" "http://$url/hosting_client/enable_sites"

  echo -e "\nDelete client Coconut\n\n"
  curl -i -X DELETE "http://$url/hosting_client/coconut"

  # Finish up the testing
  echo -e "\nCompleted test of $url\n"
else
  echo -e "\nAborted test of $url\n"
  exit
fi

from sites.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.