@Override
	public void terminateMachine( TargetHandlerParameters parameters, String instanceId ) throws TargetException {

		// instanceID is CloudServiceName
		try {
			final AzureProperties azureProperties = buildProperties( parameters.getTargetProperties());
			String baseURL = String.format("https://management.core.windows.net/%s/services", azureProperties.getSubscriptionId());
			String deleteCloudServiceURL = baseURL+"/hostedservices/"+instanceId+"?comp=media";

			// Delete Cloud Service, and also delete all the related things
			int rescodeDeleteCloudService = processDeleteRequest(
					new URL(deleteCloudServiceURL),
					azureProperties.getKeyStoreFile(),
					azureProperties.getKeyStorePassword());		// rescode shoud be 202

			this.logger.info("Response Code: Delete VM: " + rescodeDeleteCloudService);

		} catch( Exception e ) {
			throw new TargetException( e );
		}
	}
@ Override public void terminateMachine ( TargetHandlerParameters parameters , String instanceId ) throws TargetException { try { final AzureProperties azureProperties = buildProperties ( parameters . getTargetProperties ( ) ) ; String baseURL = String . format ( "https://management.core.windows.net/%s/services" , azureProperties . getSubscriptionId ( ) ) ; String deleteCloudServiceURL = baseURL + "/hostedservices/" + instanceId + "?comp=media" ; int rescodeDeleteCloudService = processDeleteRequest ( new URL ( deleteCloudServiceURL ) , azureProperties . getKeyStoreFile ( ) , azureProperties . getKeyStorePassword ( ) ) ; this . logger . info ( "Response Code: Delete VM: " + rescodeDeleteCloudService ) ; } catch ( Exception e ) { throw new TargetException ( e ) ; } }
/*
(non-Javadoc)
@see net.roboconf.target.api.TargetHandler
#terminateMachine(net.roboconf.target.api.TargetHandlerParameters, java.lang.String)