createUser Create User and Account username password apiuser firstname apiuser lastname apiuser email apiuser@gmail.com accounttype 0 id userid account accountname registerUserKeys Registering the User id userid apikey apikey secretkey secretkey createNetworkGroup true Create a Network Group name networkgrp-1 authorizeNetworkGroupIngress Add the First Ingress Rule networkgroupname networkgrp-1 cidrlist 192.168.131.171/32 endport 22 startport 22 protocol tcp account accountname domainid 1 deployVirtualMachine true Deploy a VM with the Network Group Assigned zoneid globalzoneid serviceofferingid flatnetworkserviceofferingid networkgrouplist networkgrp-1 templateid globaltemplateid id vmid ipaddress vmip sleep.sh Sleep for 2 min s 120 ssh.sh Ssh access test for the VM h vmip p password sleep.sh Sleep for 1 min s 60 stopVirtualMachine true Stopping VM id vmid startVirtualMachine true Starting VM id vmid rebootVirtualMachine true Rebooting VM id vmid revokeNetworkGroupIngress Revoke The First Ingress Rule networkgroupname networkgrp-1 cidrlist 192.168.131.171/32 endport 22 startport 22 protocol tcp account accountname domainid 1 ssh.sh true Ssh access test for the vm - should fail as ingress rule is revoked h vmip p password authorizeNetworkGroupIngress Add the Second Ingress Rule networkgroupname networkgrp-1 cidrlist 192.168.131.172/32 endport 22 startport 22 protocol tcp account accountname domainid 1 deployVirtualMachine true Deploy a VM with the Network Group Assigned zoneid globalzoneid serviceofferingid flatnetworkserviceofferingid networkgrouplist networkgrp-1 templateid globaltemplateid id vmid ipaddress vmip sleep.sh Sleep for 2 min s 120 ssh.sh true Ssh test for the vm - should fail as no access provided by ingress rule h vmip p password revokeNetworkGroupIngress Revoke The Second Ingress Rule networkgroupname networkgrp-1 cidrlist 192.168.131.172/32 endport 22 startport 22 protocol tcp account accountname domainid 1 authorizeNetworkGroupIngress Add the Third Ingress Rule networkgroupname networkgrp-1 cidrlist 192.168.131.0/24 endport 80 startport 80 protocol tcp account accountname domainid 1 deployVirtualMachine true Deploy a VM with the Network Group Assigned zoneid globalzoneid serviceofferingid flatnetworkserviceofferingid networkgrouplist networkgrp-1 templateid globaltemplateid id vmid ipaddress vmip sleep.sh Sleep for 2 min s 120 ssh.sh true Ssh test for the vm - should fail as no access provided by ingress rule h vmip p password revokeNetworkGroupIngress Revoke The Third Ingress Rule networkgroupname networkgrp-1 cidrlist 192.168.131.0/24 endport 80 startport 80 protocol tcp account accountname domainid 1 authorizeNetworkGroupIngress Add the Fourth Ingress Rule networkgroupname networkgrp-1 cidrlist 192.168.130.0/24 endport 80 startport 80 protocol tcp account accountname domainid 1 deployVirtualMachine true Deploy a VM with the Network Group Assigned zoneid globalzoneid serviceofferingid flatnetworkserviceofferingid networkgrouplist networkgrp-1 templateid globaltemplateid id vmid ipaddress vmip sleep.sh Sleep for 2 min s 120 ssh.sh true Ssh test for the vm - should fail as no access provided by ingress rule h vmip p password revokeNetworkGroupIngress Revoke The Fourth Ingress Rule networkgroupname networkgrp-1 cidrlist 192.168.130.0/24 endport 80 startport 80 protocol tcp account accountname domainid 1 deleteNetworkGroup true Delete First network group name networkgrp-1 destroyVirtualMachine true Destroying virutal machine id vmid sleep.sh Sleep for 2 min s 120 deleteUser Deleting the user id userid