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

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

本文整理了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

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

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

  1. /**
  2. * Get all redis caches.
  3. * @return A map containing RedisCaches with subscription id as the key
  4. * @throws IOException getAzureManager Exception
  5. */
  6. public HashMap<String, RedisCaches> getRedisCaches() throws IOException {
  7. HashMap<String, RedisCaches> redisCacheMaps = new HashMap<>();
  8. List<Subscription> subscriptions = AzureMvpModel.getInstance().getSelectedSubscriptions();
  9. for (Subscription subscription : subscriptions) {
  10. Azure azure = AuthMethodManager.getInstance().getAzureClient(subscription.subscriptionId());
  11. if (azure.redisCaches() == null) {
  12. continue;
  13. }
  14. redisCacheMaps.put(subscription.subscriptionId(), azure.redisCaches());
  15. }
  16. return redisCacheMaps;
  17. }

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

  1. /**
  2. * Get a Redis Cache by Id.
  3. * @param sid Subscription Id
  4. * @param id Redis cache's id
  5. * @return Redis Cache Object
  6. * @throws IOException getAzureManager Exception
  7. */
  8. public RedisCache getRedisCache(String sid, String id) throws IOException {
  9. Azure azure = AuthMethodManager.getInstance().getAzureClient(sid);
  10. RedisCaches redisCaches = azure.redisCaches();
  11. if (redisCaches == null) {
  12. return null;
  13. }
  14. return redisCaches.getById(id);
  15. }

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

  1. /**
  2. * Delete a redis cache.
  3. * @param sid Subscription Id
  4. * @param id Redis cache's id
  5. * @throws IOException getAzureManager Exception
  6. */
  7. public void deleteRedisCache(String sid, String id) throws IOException {
  8. Azure azure = AuthMethodManager.getInstance().getAzureClient(sid);
  9. RedisCaches redisCaches = azure.redisCaches();
  10. if (redisCaches == null) {
  11. return;
  12. }
  13. redisCaches.deleteById(id);
  14. }
  15. }

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

  1. boolean newResGrp) {
  2. if (azure != null) {
  3. RedisCacheCreator creator = new RedisCacheCreator(azure.redisCaches(),
  4. dnsNameValue,
  5. selectedRegionValue,

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

  1. public static void doValidate(SubscriptionDetail currentSub, String dnsNameValue, String selectedRegionValue, String selectedResGrpValue, String selectedPriceTierValue) throws InvalidFormDataException {
  2. if (currentSub == null) {
  3. throw new InvalidFormDataException(REQUIRE_SUBSCRIPTION);
  4. }
  5. if (dnsNameValue == null || dnsNameValue.isEmpty() || !dnsNameValue.matches("^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$") || dnsNameValue.length() > 63) {
  6. throw new InvalidFormDataException(INVALID_REDIS_CACHE_NAME);
  7. }
  8. if (selectedRegionValue == null || selectedRegionValue.isEmpty()) {
  9. throw new InvalidFormDataException(REQUIRE_LOCATION);
  10. }
  11. if (selectedResGrpValue == null || selectedResGrpValue.isEmpty()) {
  12. throw new InvalidFormDataException(REQUIRE_RESOURCE_GROUP);
  13. }
  14. if (selectedPriceTierValue == null || selectedPriceTierValue.isEmpty()) {
  15. throw new InvalidFormDataException(REQUIRE_PRICE_TIER);
  16. }
  17. try {
  18. Azure azure = AuthMethodManager.getInstance().getAzureClient(currentSub.getSubscriptionId());
  19. for (RedisCache existingRedisCache : azure.redisCaches().list()) {
  20. if (existingRedisCache.name().equals(dnsNameValue)) {
  21. throw new InvalidFormDataException("The name " + dnsNameValue + " is not available");
  22. }
  23. }
  24. } catch (IOException e) {
  25. e.printStackTrace();
  26. }
  27. }

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

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

相关文章