Package groovyx.net.http

Examples of groovyx.net.http.HttpResponseDecorator


        MDCBuilder.buildMdcContext(aRRPO.getStack());
        LOGGER.info("Checking status of remove disk '{}' on '{}' stack.", aRRPO.getName(), aRRPO.getStack().getId());
        try {
            Map<String, String> props = new HashMap<>();
            props.put(NAME, aRRPO.getName());
            HttpResponseDecorator deleteDisk = (HttpResponseDecorator) aRRPO.getAzureClient().deleteDisk(props);
            String requestId = (String) aRRPO.getAzureClient().getRequestId(deleteDisk);
            waitForFinishing(aRRPO.getAzureClient(), requestId);
        } catch (HttpResponseException ex) {
            if (ex.getStatusCode() != NOT_FOUND) {
                return false;
View Full Code Here


        try {
            Map<String, String> props = new HashMap<>();
            props.put(SERVICENAME, aRRPO.getCommonName());
            props.put(NAME, aRRPO.getName());
            AzureClient azureClient = aRRPO.getAzureClient();
            HttpResponseDecorator deleteCloudServiceResult = (HttpResponseDecorator) azureClient.deleteCloudService(props);
            String requestId = (String) azureClient.getRequestId(deleteCloudServiceResult);
            waitForFinishing(azureClient, requestId);
        } catch (HttpResponseException ex) {
            if (ex.getStatusCode() != NOT_FOUND) {
                return false;
View Full Code Here

            if (ex instanceof HttpResponseException && ((HttpResponseException) ex).getStatusCode() == NOT_FOUND) {
                Map<String, String> params = new HashMap<>();
                params.put(AzureStackUtil.NAME, affinityGroupName);
                params.put(DESCRIPTION, VM_COMMON_NAME);
                params.put(AFFINITYGROUP, affinityGroupName);
                HttpResponseDecorator response = (HttpResponseDecorator) azureClient.createStorageAccount(params);
                String requestId = (String) azureClient.getRequestId(response);
                waitUntilComplete(azureClient, requestId);
            } else {
                LOGGER.error(String.format("Error occurs on %s stack under the storage creation", stack.getId()), ex);
                throw new InternalServerException(ex.getMessage());
View Full Code Here

            props.put(DATA, new String(sshCert.getPem()));
        } catch (CertificateEncodingException e) {
            throw new StackCreationFailureException(e);
        }
        AzureClient azureClient = po.getNewAzureClient(azureCredential);
        HttpResponseDecorator serviceCertificate = (HttpResponseDecorator) azureClient.createServiceCertificate(props);
        String requestId = (String) azureClient.getRequestId(serviceCertificate);
        waitUntilComplete(azureClient, requestId);
        return Arrays.asList(new Resource(resourceType(), name, stack));
    }
View Full Code Here

        Map<String, String> props = new HashMap<>();
        props.put(NAME, vmName);
        props.put(DESCRIPTION, azureTemplate.getDescription());
        props.put(AFFINITYGROUP, po.getCommonName());
        AzureClient azureClient = po.getNewAzureClient(azureCredential);
        HttpResponseDecorator cloudServiceResponse = (HttpResponseDecorator) azureClient.createCloudService(props);
        String requestId = (String) azureClient.getRequestId(cloudServiceResponse);
        waitUntilComplete(azureClient, requestId);
        return Arrays.asList(new Resource(ResourceType.AZURE_CLOUD_SERVICE, vmName, stack));
    }
View Full Code Here

            if (((HttpResponseException) ex).getStatusCode() == NOT_FOUND) {
                Map<String, String> props = new HashMap<>();
                props.put(NAME, po.getCommonName());
                props.put(LOCATION, template.getLocation().location());
                props.put(DESCRIPTION, template.getDescription());
                HttpResponseDecorator affinityResponse = (HttpResponseDecorator) po.getAzureClient().createAffinityGroup(props);
                String requestId = (String) po.getAzureClient().getRequestId(affinityResponse);
                waitUntilComplete(po.getAzureClient(), requestId);
            } else if (ex instanceof HttpResponseException) {
                LOGGER.error(String.format("Error occurs on %s stack under the affinity group creation", stack.getId()), ex);
                throw new InternalServerException(((HttpResponseException) ex).getResponse().toString());
View Full Code Here

            if (((HttpResponseException) ex).getStatusCode() == NOT_FOUND) {
                Map<String, String> props = new HashMap<>();
                props.put(NAME, po.getCommonName());
                props.put(DESCRIPTION, template.getDescription());
                props.put(AFFINITYGROUP, po.getCommonName());
                HttpResponseDecorator storageResponse = (HttpResponseDecorator) po.getAzureClient().createStorageAccount(props);
                String requestId = (String) po.getAzureClient().getRequestId(storageResponse);
                waitUntilComplete(po.getAzureClient(), requestId);
            } else if (ex instanceof HttpResponseException) {
                LOGGER.error(String.format("Error occurs on %s stack under the storage creation", stack.getId()), ex);
                throw new InternalServerException(((HttpResponseException) ex).getResponse().toString());
View Full Code Here

            props.put(NAME, name);
            props.put(AFFINITYGROUP, po.getCommonName());
            props.put(SUBNETNAME, name);
            props.put(ADDRESSPREFIX, "172.16.0.0/16");
            props.put(SUBNETADDRESSPREFIX, "172.16.0.0/24");
            HttpResponseDecorator virtualNetworkResponse = (HttpResponseDecorator) po.getAzureClient().createVirtualNetwork(props);
            String requestId = (String) po.getAzureClient().getRequestId(virtualNetworkResponse);
            waitUntilComplete(po.getAzureClient(), requestId);
        }
        return Arrays.asList(new Resource(ResourceType.AZURE_NETWORK, name, stack));
    }
View Full Code Here

        Map<String, String> props;
        try {
            props = new HashMap<>();
            props.put(NAME, resource.getResourceName());
            AzureClient azureClient = aDCO.getNewAzureClient(credential);
            HttpResponseDecorator deleteVirtualNetworkResult = (HttpResponseDecorator) azureClient.deleteVirtualNetwork(props);
            String requestId = (String) azureClient.getRequestId(deleteVirtualNetworkResult);
            boolean finished = azureClient.waitUntilComplete(requestId);
        } catch (HttpResponseException ex) {
            httpResponseExceptionHandler(ex, resource.getResourceName(), stack.getOwner(), stack);
        } catch (Exception ex) {
View Full Code Here

        props.put(CUSTOMDATA, new String(Base64.encodeBase64(po.getUserData().getBytes())));
        props.put(VIRTUALNETWORKNAME, po.filterResourcesByType(ResourceType.AZURE_NETWORK).get(0).getResourceName());
        props.put(PORTS, ports);
        props.put(VMTYPE, AzureVmType.valueOf(azureTemplate.getVmType()).vmType().replaceAll(" ", ""));
        AzureClient azureClient = po.getNewAzureClient(azureCredential);
        HttpResponseDecorator virtualMachineResponse = (HttpResponseDecorator) azureClient.createVirtualMachine(props);
        String requestId = (String) azureClient.getRequestId(virtualMachineResponse);
        waitUntilComplete(azureClient, requestId);
        return Arrays.asList(new Resource(resourceType(), vmName, stack));
    }
View Full Code Here

TOP

Related Classes of groovyx.net.http.HttpResponseDecorator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.