Terminate your service zone option

REST: POST /ipLoadbalancing/{serviceName}/zone/{name}/terminate
@param serviceName [required] The internal name of your IP load balancing
@param name [required] Name of your zone
336653
public void serviceName_zone_name_terminate_POST(String serviceName, String name) throws IOException {
		String qPath = "/ipLoadbalancing/{serviceName}/zone/{name}/terminate";
		StringBuilder sb = path(qPath, serviceName, name);
		exec(qPath, "POST", sb.toString(), null);
	}
106325
def stop_service(name):
        
        with win32.OpenSCManager(
            dwDesiredAccess = win32.SC_MANAGER_CONNECT
        ) as hSCManager:
            with win32.OpenService(hSCManager, name,
                                   dwDesiredAccess = win32.SERVICE_STOP
            ) as hService:
                win32.ControlService(hService, win32.SERVICE_CONTROL_STOP)
1263292
public void serviceName_task_taskId_cancel_POST(String serviceName, Long taskId) throws IOException {
		String qPath = "/dedicated/housing/{serviceName}/task/{taskId}/cancel";
		StringBuilder sb = path(qPath, serviceName, taskId);
		exec(qPath, "POST", sb.toString(), null);
	}
954509
public void zone_zoneName_dnssec_POST(String zoneName) throws IOException {
		String qPath = "/domain/zone/{zoneName}/dnssec";
		StringBuilder sb = path(qPath, zoneName);
		exec(qPath, "POST", sb.toString(), null);
	}
964175
private void stopProcessEngine(String serviceName, PlatformServiceContainer serviceContainer) {

    try {
      serviceContainer.stopService(serviceName);
    }
    catch(Exception e) {
      LOG.exceptionWhileStopping("Process Engine", serviceName, e);
    }

  }
1268044
public static final void serverName(String name)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "serverName", name);

        _serverName = name;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "serverName");
    }
427587
public static void stop(Service service) {
    if (service != null) {
      Service.STATE state = service.getServiceState();
      if (state == Service.STATE.STARTED) {
        service.stop();
      }
    }
  }
619728
public void removeHostName(String hostName) {
		if(logger.isDebugEnabled()) {
			logger.debug("Removing hostname "+ hostName);
		}
		hostNames.remove(hostName);
		if(dnsServerLocator != null) {
			dnsServerLocator.removeLocalHostName(hostName);
		}
	}
622786
public void serviceName_lines_number_diagnostic_cancel_POST(String serviceName, String number) throws IOException {
		String qPath = "/xdsl/{serviceName}/lines/{number}/diagnostic/cancel";
		StringBuilder sb = path(qPath, serviceName, number);
		exec(qPath, "POST", sb.toString(), null);
	}
716132
def remove(self, name):
        
        init = self._get_implementation(name)
        self._assert_service_installed(init, name)
        logger.info('Removing %s service %s...', self.init_system, name)
        init.stop()
        init.uninstall()
        logger.info('Service removed')
1178022
public void unregisterServiceInstance(String serviceName, String instanceId){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.UnregisterServiceInstance);

        UnregisterServiceInstanceProtocol p = new UnregisterServiceInstanceProtocol(serviceName, instanceId);
        connection.submitRequest(header, p, null);
    }
479214
public static boolean isValidServiceId(String name) {
        return name != null && name.length() > 0 && SERVICE_ID_REGEX.matcher(name).matches() && Character.isLetter(name.charAt(0));
    }
668123
private void unregisterMBeanInService(String name) {
        ServiceRegistration<DynamicMBean> existingMBean = endpointMBeans.remove(name);
        if (existingMBean != null) {
            existingMBean.unregister();
        }
    }
46320
public void removeNameUrl(final String name, final String url) 
	throws IOException {
		doPostMethod(ResourceFileLocationDBServlet.REMOVE_OPERATION, name, url);
	}
90533
public void serviceName_topic_topicId_DELETE(String serviceName, String topicId) throws IOException {
		String qPath = "/dbaas/queue/{serviceName}/topic/{topicId}";
		StringBuilder sb = path(qPath, serviceName, topicId);
		exec(qPath, "DELETE", sb.toString(), null);
	}
136853
@Override
    public void removeEndPoint(String name) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Deleting endpoint: " + name);
        }

        synchronized (this.endpoints) {
            if (this.endpoints.remove(name) != null) {
                unregisterMBeanInService(name);
            }
        }
    }
911317
def StopService(service_name, service_binary_name=None):
  
  # QueryServiceStatus returns: scvType, svcState, svcControls, err,
  # svcErr, svcCP, svcWH
  try:
    status = win32serviceutil.QueryServiceStatus(service_name)[1]
  except pywintypes.error as e:
    if getattr(e, "winerror", None) == winerror.ERROR_SERVICE_DOES_NOT_EXIST:
      logging.debug("Tried to stop '%s', but the service is not installed.",
                    service_name)
    else:
      logging.exception("Unable to query status of service '%s':", service_name)
    return

  for _ in range(20):
    if status == win32service.SERVICE_STOPPED:
      break
    elif status != win32service.SERVICE_STOP_PENDING:
      try:
        win32serviceutil.StopService(service_name)
      except pywintypes.error:
        logging.exception("Unable to stop service '%s':", service_name)
    time.sleep(1)
    status = win32serviceutil.QueryServiceStatus(service_name)[1]

  if status == win32service.SERVICE_STOPPED:
    logging.info("Service '%s' stopped.", service_name)
    return
  elif not service_binary_name:
    return

  # Taskkill will fail on systems predating Windows XP, this is a best
  # effort fallback solution.
  output = subprocess.check_output(
      ["taskkill", "/im", "%s*" % service_binary_name, "/f"],
      shell=True,
      stdin=subprocess.PIPE,
      stderr=subprocess.PIPE)

  logging.debug("%s", output)

  # Sleep a bit to ensure that process really quits.
  time.sleep(2)