Package com.microsoft.windowsazure.management.storage.models

Examples of com.microsoft.windowsazure.management.storage.models.StorageAccountGetKeysResponse


        StorageAccount storageAccount = storageAccountGetResponse.getStorageAccount();
        return storageAccount;
     }
   
    protected static String getStorageKey(String storageAccountName) throws IOException, ServiceException, ParserConfigurationException, SAXException, URISyntaxException {
        StorageAccountGetKeysResponse storageAccountGetKeyResponse = storageManagementClient.getStorageAccountsOperations().getKeys(storageAccountName);
        return storageAccountGetKeyResponse.getPrimaryKey();
    }
View Full Code Here


                }
                throw ex;
            }
           
            // Create Result
            StorageAccountGetKeysResponse result = null;
            // Deserialize Response
            InputStream responseContent = httpResponse.getEntity().getContent();
            result = new StorageAccountGetKeysResponse();
            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document responseDoc = documentBuilder.parse(new BOMInputStream(responseContent));
           
            Element storageServiceElement = XmlUtility.getElementByTagNameNS(responseDoc, "http://schemas.microsoft.com/windowsazure", "StorageService");
            if (storageServiceElement != null) {
                Element urlElement = XmlUtility.getElementByTagNameNS(storageServiceElement, "http://schemas.microsoft.com/windowsazure", "Url");
                if (urlElement != null) {
                    URI urlInstance;
                    urlInstance = new URI(urlElement.getTextContent());
                    result.setUri(urlInstance);
                }
               
                Element storageServiceKeysElement = XmlUtility.getElementByTagNameNS(storageServiceElement, "http://schemas.microsoft.com/windowsazure", "StorageServiceKeys");
                if (storageServiceKeysElement != null) {
                    Element primaryElement = XmlUtility.getElementByTagNameNS(storageServiceKeysElement, "http://schemas.microsoft.com/windowsazure", "Primary");
                    if (primaryElement != null) {
                        String primaryInstance;
                        primaryInstance = primaryElement.getTextContent();
                        result.setPrimaryKey(primaryInstance);
                    }
                   
                    Element secondaryElement = XmlUtility.getElementByTagNameNS(storageServiceKeysElement, "http://schemas.microsoft.com/windowsazure", "Secondary");
                    if (secondaryElement != null) {
                        String secondaryInstance;
                        secondaryInstance = secondaryElement.getTextContent();
                        result.setSecondaryKey(secondaryInstance);
                    }
                }
            }
           
            result.setStatusCode(statusCode);
            if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
                result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
            }
           
            if (shouldTrace) {
                CloudTracing.exit(invocationId, result);
            }
View Full Code Here

        //act
        OperationResponse operationResponse = storageManagementClient.getStorageAccountsOperations().create(createParameters);
        Assert.assertEquals(200, operationResponse.getStatusCode());
        
        //use container inside storage account, needed for os image storage.
        StorageAccountGetKeysResponse storageAccountGetKeysResponse = storageManagementClient.getStorageAccountsOperations().getKeys(storageAccountName);
        storageAccountKey = storageAccountGetKeysResponse.getPrimaryKey();
        storageEndpointUri = storageManagementClient.getStorageAccountsOperations().get(storageAccountName).getStorageAccount().getProperties().getEndpoints().get(0);
    }
View Full Code Here

        //Assert
        Assert.assertEquals(200, operationResponse.getStatusCode());

        //use container inside storage account, needed for os image storage.
        StorageAccountGetKeysResponse storageAccountGetKeysResponse = storageManagementClient.getStorageAccountsOperations().getKeys(storageAccountName);
        storageAccountKey = storageAccountGetKeysResponse.getPrimaryKey();
        CloudBlobClient blobClient = createBlobClient(storageAccountName, storageAccountKey);
        CloudBlobContainer container = blobClient.getContainerReference(storageContainer);     
        container.createIfNotExists();

        //make sure it created and available, otherwise vm deployment will fail with storage/container still creating
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.management.storage.models.StorageAccountGetKeysResponse

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.