Package com.sequenceiq.cloud.azure.client

Examples of com.sequenceiq.cloud.azure.client.AzureClient


    private UserDetailsService userDetailsService;

    @Override
    public AzureProvisionContextObject provisionInit(Stack stack, String userData) throws Exception {
        AzureCredential credential = (AzureCredential) stack.getCredential();
        AzureClient azureClient = createAzureClient(credential, AzureCertificateService.getUserJksFileName(credential, emailAsFolder(stack.getOwner())));
        AzureProvisionContextObject azureProvisionContextObject =
                new AzureProvisionContextObject(stack.getId(), credential.getCommonName(), azureClient, emailAsFolder(stack.getOwner()),
                        getOsImageName(credential), userData);
        return azureProvisionContextObject;
    }
View Full Code Here


    }

    @Override
    public AzureDeleteContextObject deleteInit(Stack stack) throws Exception {
        AzureCredential credential = (AzureCredential) stack.getCredential();
        AzureClient azureClient = createAzureClient(credential, AzureCertificateService.getUserJksFileName(credential, emailAsFolder(stack.getOwner())));
        AzureDeleteContextObject azureDeleteContextObject =
                new AzureDeleteContextObject(stack.getId(), credential.getCommonName(), azureClient, emailAsFolder(stack.getOwner()));
        return azureDeleteContextObject;
    }
View Full Code Here

    }

    @Override
    public AzureStartStopContextObject startStopInit(Stack stack) throws Exception {
        AzureCredential credential = (AzureCredential) stack.getCredential();
        AzureClient azureClient = createAzureClient(credential, AzureCertificateService.getUserJksFileName(credential, emailAsFolder(stack.getOwner())));
        return new AzureStartStopContextObject(stack, azureClient, emailAsFolder(stack.getOwner()));
    }
View Full Code Here

    }

    @Override
    public AzureDescribeContextObject describeInit(Stack stack) throws Exception {
        AzureCredential credential = (AzureCredential) stack.getCredential();
        AzureClient azureClient = createAzureClient(credential, AzureCertificateService.getUserJksFileName(credential, emailAsFolder(stack.getOwner())));
        AzureDescribeContextObject azureDescribeContextObject =
                new AzureDescribeContextObject(stack.getId(), credential.getCommonName(), azureClient, emailAsFolder(stack.getOwner()));
        return azureDescribeContextObject;
    }
View Full Code Here

    }


    protected AzureClient createAzureClient(AzureCredential credential, String filePath) {
        File file = new File(filePath);
        return new AzureClient(credential.getSubscriptionId(), file.getAbsolutePath(), credential.getJks());
    }
View Full Code Here

        try {
            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

        LOGGER.info("Checking status of remove cloud service '{}'.", aRRPO.getName());
        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

    @Override
    public void setupMetadata(Stack stack) {
        MDCBuilder.buildMdcContext(stack);
        AzureCredential azureCredential = (AzureCredential) stack.getCredential();
        String filePath = AzureCertificateService.getUserJksFileName(azureCredential, azureStackUtil.emailAsFolder(stack.getOwner()));
        AzureClient azureClient = azureStackUtil.createAzureClient(azureCredential, filePath);
        Set<CoreInstanceMetaData> instanceMetaDatas = collectMetaData(stack, azureClient);
        LOGGER.info("Publishing {} event [StackId: '{}']", ReactorConfig.METADATA_SETUP_COMPLETE_EVENT, stack.getId());
        reactor.notify(ReactorConfig.METADATA_SETUP_COMPLETE_EVENT,
                Event.wrap(new MetadataSetupComplete(CloudPlatform.AZURE, stack.getId(), instanceMetaDatas)));
    }
View Full Code Here

    @Override
    public void addNewNodesToMetadata(Stack stack, Set<Resource> resourceList) {
        MDCBuilder.buildMdcContext(stack);
        AzureCredential azureCredential = (AzureCredential) stack.getCredential();
        String filePath = AzureCertificateService.getUserJksFileName(azureCredential, azureStackUtil.emailAsFolder(stack.getOwner()));
        AzureClient azureClient = azureStackUtil.createAzureClient(azureCredential, filePath);
        List<Resource> resources = new ArrayList<>();
        for (Resource resource : resourceList) {
            if (ResourceType.AZURE_VIRTUAL_MACHINE.equals(resource.getResourceType())) {
                resources.add(resource);
            }
View Full Code Here

        return String.format("%s-%s", ((AzureCredential) credential).getCommonName(), IMAGE_NAME);
    }

    public AzureClient createAzureClient(Credential credential, String filePath) {
        File file = new File(filePath);
        return new AzureClient(
                ((AzureCredential) credential).getSubscriptionId(), file.getAbsolutePath(), ((AzureCredential) credential).getJks());
    }
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloud.azure.client.AzureClient

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.