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

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

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

Azure.redisCaches介绍

暂无

代码示例

代码示例来源:origin: Microsoft/spring-cloud-azure

@Override
public RedisCache internalGet(String name) {
  return azure.redisCaches().getByResourceGroup(azureProperties.getResourceGroup(), name);
}

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

/**
 * Get all redis caches.
 * @return A map containing RedisCaches with subscription id as the key
 * @throws IOException getAzureManager Exception
 */
public HashMap<String, RedisCaches> getRedisCaches() throws IOException {
  HashMap<String, RedisCaches> redisCacheMaps = new HashMap<>();
  List<Subscription> subscriptions = AzureMvpModel.getInstance().getSelectedSubscriptions();
  for (Subscription subscription : subscriptions) {
    Azure azure = AuthMethodManager.getInstance().getAzureClient(subscription.subscriptionId());
    if (azure.redisCaches() == null) {
      continue;
    }
    redisCacheMaps.put(subscription.subscriptionId(), azure.redisCaches());
  }
  return redisCacheMaps;
}

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

/**
 * Get a Redis Cache by Id.
 * @param sid Subscription Id
 * @param id Redis cache's id
 * @return Redis Cache Object
 * @throws IOException getAzureManager Exception
 */
public RedisCache getRedisCache(String sid, String id) throws IOException {
  Azure azure = AuthMethodManager.getInstance().getAzureClient(sid);
  RedisCaches redisCaches = azure.redisCaches();
  if (redisCaches == null) {
    return null;
  }
  return redisCaches.getById(id);
}

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

/**
   * Delete a redis cache.
   * @param sid Subscription Id
   * @param id Redis cache's id
   * @throws IOException getAzureManager Exception
   */
  public void deleteRedisCache(String sid, String id) throws IOException {
    Azure azure = AuthMethodManager.getInstance().getAzureClient(sid);
    RedisCaches redisCaches = azure.redisCaches();
    if (redisCaches == null) {
      return;
    }
    redisCaches.deleteById(id);
  }
}

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

boolean newResGrp) {
if (azure != null) {
  RedisCacheCreator creator = new RedisCacheCreator(azure.redisCaches(),
      dnsNameValue,
      selectedRegionValue,

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

public static void doValidate(SubscriptionDetail currentSub, String dnsNameValue, String selectedRegionValue, String selectedResGrpValue, String selectedPriceTierValue) throws InvalidFormDataException {
  if (currentSub == null) {
    throw new InvalidFormDataException(REQUIRE_SUBSCRIPTION);
  }
  if (dnsNameValue == null || dnsNameValue.isEmpty() || !dnsNameValue.matches("^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$") || dnsNameValue.length() > 63) {
    throw new InvalidFormDataException(INVALID_REDIS_CACHE_NAME);
  }
  if (selectedRegionValue == null || selectedRegionValue.isEmpty()) {
    throw new InvalidFormDataException(REQUIRE_LOCATION);
  }
  if (selectedResGrpValue == null || selectedResGrpValue.isEmpty()) {
    throw new InvalidFormDataException(REQUIRE_RESOURCE_GROUP);
  }
  if (selectedPriceTierValue == null || selectedPriceTierValue.isEmpty()) {
    throw new InvalidFormDataException(REQUIRE_PRICE_TIER);
  }
  try {
    Azure azure = AuthMethodManager.getInstance().getAzureClient(currentSub.getSubscriptionId());
    for (RedisCache existingRedisCache : azure.redisCaches().list()) {
      if (existingRedisCache.name().equals(dnsNameValue)) {
        throw new InvalidFormDataException("The name " + dnsNameValue + " is not available");
      }
    }
  } catch (IOException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: Microsoft/spring-cloud-azure

@Override
  public RedisCache internalCreate(String name) {
    return azure.redisCaches().define(name).withRegion(azureProperties.getRegion())
          .withExistingResourceGroup(azureProperties.getResourceGroup()).withBasicSku().create();
  }
}

相关文章