com.microsoft.azure.management.Azure.subscriptionId()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(284)

本文整理了Java中com.microsoft.azure.management.Azure.subscriptionId()方法的一些代码示例,展示了Azure.subscriptionId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Azure.subscriptionId()方法的具体详情如下:
包路径:com.microsoft.azure.management.Azure
类名称:Azure
方法名:subscriptionId

Azure.subscriptionId介绍

暂无

代码示例

代码示例来源:origin: Microsoft/azure-tools-for-java

  1. public static Map<String, DockerHost> getDockerHosts(Azure azureClient, Map<String, AzureDockerCertVault> dockerVaultsMap) {
  2. Map<String, DockerHost> dockerHostMap = getDockerHosts(azureClient.virtualMachines().list(), dockerVaultsMap);
  3. for (DockerHost dockerHost : dockerHostMap.values()) {
  4. dockerHost.sid = azureClient.subscriptionId();
  5. if (dockerHost.hostVM != null) dockerHost.hostVM.sid = azureClient.subscriptionId();
  6. }
  7. return dockerHostMap;
  8. }

代码示例来源:origin: com.microsoft.azure/azure

  1. /**
  2. * @return the currently selected subscription this client is authenticated to work with
  3. */
  4. public Subscription getCurrentSubscription() {
  5. return this.subscriptions().getById(this.subscriptionId());
  6. }

代码示例来源:origin: Azure/azure-libraries-for-java

  1. /**
  2. * @return the currently selected subscription this client is authenticated to work with
  3. */
  4. public Subscription getCurrentSubscription() {
  5. return this.subscriptions().getById(this.subscriptionId());
  6. }

代码示例来源:origin: Microsoft/azure-tools-for-java

  1. public static AzureDockerVM getDockerVM(Azure azureClient, String resourceGroup, String hostName) {
  2. try {
  3. AzureDockerVM azureDockerVM = getDockerVM(azureClient.virtualMachines().getByResourceGroup(resourceGroup, hostName));
  4. azureDockerVM.sid = azureClient.subscriptionId();
  5. return azureDockerVM;
  6. } catch (Exception e) {
  7. throw new AzureDockerException(e.getMessage(), e);
  8. }
  9. }

代码示例来源:origin: Microsoft/azure-tools-for-java

  1. public static List<AzureDockerStorageAccount> getStorageAccounts(Azure azureClient) {
  2. List<AzureDockerStorageAccount> result = new ArrayList<>();
  3. if (azureClient != null) {
  4. for (StorageAccount storageAccount : azureClient.storageAccounts().list()) {
  5. AzureDockerStorageAccount dockerStorageAccount = new AzureDockerStorageAccount();
  6. dockerStorageAccount.name = storageAccount.name();
  7. dockerStorageAccount.region = storageAccount.regionName();
  8. dockerStorageAccount.resourceGroup = storageAccount.resourceGroupName();
  9. dockerStorageAccount.sid = azureClient.subscriptionId();
  10. dockerStorageAccount.skuType = storageAccount.sku().name().name();
  11. result.add(dockerStorageAccount);
  12. }
  13. }
  14. return result;
  15. }

代码示例来源:origin: Microsoft/azure-maven-plugins

  1. public Azure getAzureClient() throws AzureAuthFailureException {
  2. if (azure == null) {
  3. azure = azureAuthHelper.getAzureClient();
  4. if (azure == null) {
  5. getTelemetryProxy().trackEvent(INIT_FAILURE);
  6. throw new AzureAuthFailureException(AZURE_INIT_FAIL);
  7. } else {
  8. // Repopulate subscriptionId in case it is not configured.
  9. getTelemetryProxy().addDefaultProperty(SUBSCRIPTION_ID_KEY, azure.subscriptionId());
  10. }
  11. }
  12. return azure;
  13. }

代码示例来源:origin: com.microsoft.azure/azure-maven-plugin-lib

  1. public Azure getAzureClient() throws AzureAuthFailureException {
  2. if (azure == null) {
  3. azure = azureAuthHelper.getAzureClient();
  4. if (azure == null) {
  5. getTelemetryProxy().trackEvent(INIT_FAILURE);
  6. throw new AzureAuthFailureException(AZURE_INIT_FAIL);
  7. } else {
  8. // Repopulate subscriptionId in case it is not configured.
  9. getTelemetryProxy().addDefaultProperty(SUBSCRIPTION_ID_KEY, azure.subscriptionId());
  10. }
  11. }
  12. return azure;
  13. }

代码示例来源:origin: jenkinsci/azure-vm-agents-plugin

  1. properties.put(AppInsightsConstants.AZURE_SUBSCRIPTION_ID, getAzureClient().subscriptionId());
  2. properties.put(AppInsightsConstants.AZURE_LOCATION, template.getLocation());
  3. properties.put("AgentOS", template.getOsType());

相关文章