Skip to content

Commit

Permalink
CodeGen from PR 17034 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 76226a51de06fce6da33a63a999330baaff2fe1e into 85d11472e0e6d69603edb824b40f5fee71e87d2d
  • Loading branch information
SDKAuto committed Dec 9, 2021
1 parent 4f846ee commit e18f449
Show file tree
Hide file tree
Showing 40 changed files with 634 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.5 (Unreleased)
## 1.0.0-beta.1 (2021-12-09)

- Azure Resource Manager StorageCache client library for Java. This package contains Microsoft Azure SDK for StorageCache Management SDK. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
4 changes: 2 additions & 2 deletions sdk/storagecache/azure-resourcemanager-storagecache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager StorageCache client library for Java.

This package contains Microsoft Azure SDK for StorageCache Management SDK. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2021-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for StorageCache Management SDK. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-storagecache</artifactId>
<version>1.0.0-beta.4</version>
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
76 changes: 49 additions & 27 deletions sdk/storagecache/azure-resourcemanager-storagecache/SAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
## StorageTargetOperation

- [Flush](#storagetargetoperation_flush)
- [Invalidate](#storagetargetoperation_invalidate)
- [Resume](#storagetargetoperation_resume)
- [Suspend](#storagetargetoperation_suspend)

Expand All @@ -52,7 +53,7 @@ import com.azure.core.util.Context;
/** Samples for AscOperations Get. */
public final class AscOperationsGetSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/AscOperations_Get.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/AscOperations_Get.json
*/
/**
* Sample code: AscOperations_Get.
Expand Down Expand Up @@ -93,7 +94,7 @@ import java.util.Map;
/** Samples for Caches CreateOrUpdate. */
public final class CachesCreateOrUpdateSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_CreateOrUpdate_ldap_only.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_CreateOrUpdate_ldap_only.json
*/
/**
* Sample code: Caches_CreateOrUpdate_ldap_only.
Expand Down Expand Up @@ -153,7 +154,7 @@ public final class CachesCreateOrUpdateSamples {
}

/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_CreateOrUpdate.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_CreateOrUpdate.json
*/
/**
* Sample code: Caches_CreateOrUpdate.
Expand Down Expand Up @@ -250,7 +251,7 @@ import com.azure.core.util.Context;
/** Samples for Caches DebugInfo. */
public final class CachesDebugInfoSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_DebugInfo.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_DebugInfo.json
*/
/**
* Sample code: Caches_DebugInfo.
Expand All @@ -271,7 +272,7 @@ import com.azure.core.util.Context;
/** Samples for Caches Delete. */
public final class CachesDeleteSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_Delete.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Delete.json
*/
/**
* Sample code: Caches_Delete.
Expand All @@ -292,7 +293,7 @@ import com.azure.core.util.Context;
/** Samples for Caches Flush. */
public final class CachesFlushSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_Flush.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Flush.json
*/
/**
* Sample code: Caches_Flush.
Expand All @@ -313,7 +314,7 @@ import com.azure.core.util.Context;
/** Samples for Caches GetByResourceGroup. */
public final class CachesGetByResourceGroupSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_Get.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Get.json
*/
/**
* Sample code: Caches_Get.
Expand All @@ -334,7 +335,7 @@ import com.azure.core.util.Context;
/** Samples for Caches List. */
public final class CachesListSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_List.json
*/
/**
* Sample code: Caches_List.
Expand All @@ -355,7 +356,7 @@ import com.azure.core.util.Context;
/** Samples for Caches ListByResourceGroup. */
public final class CachesListByResourceGroupSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_ListByResourceGroup.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_ListByResourceGroup.json
*/
/**
* Sample code: Caches_ListByResourceGroup.
Expand All @@ -376,7 +377,7 @@ import com.azure.core.util.Context;
/** Samples for Caches Start. */
public final class CachesStartSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_Start.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Start.json
*/
/**
* Sample code: Caches_Start.
Expand All @@ -397,7 +398,7 @@ import com.azure.core.util.Context;
/** Samples for Caches Stop. */
public final class CachesStopSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_Stop.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Stop.json
*/
/**
* Sample code: Caches_Stop.
Expand Down Expand Up @@ -433,7 +434,7 @@ import java.util.Map;
/** Samples for Caches Update. */
public final class CachesUpdateSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_Update_ldap_only.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Update_ldap_only.json
*/
/**
* Sample code: Caches_Update_ldap_only.
Expand Down Expand Up @@ -510,7 +511,7 @@ public final class CachesUpdateSamples {
}

/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_Update.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Update.json
*/
/**
* Sample code: Caches_Update.
Expand Down Expand Up @@ -608,7 +609,7 @@ import com.azure.core.util.Context;
/** Samples for Caches UpgradeFirmware. */
public final class CachesUpgradeFirmwareSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Caches_UpgradeFirmware.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_UpgradeFirmware.json
*/
/**
* Sample code: Caches_UpgradeFirmware.
Expand All @@ -629,7 +630,7 @@ import com.azure.core.util.Context;
/** Samples for Operations List. */
public final class OperationsListSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Operations_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Operations_List.json
*/
/**
* Sample code: StorageTargets_List.
Expand All @@ -650,7 +651,7 @@ import com.azure.core.util.Context;
/** Samples for Skus List. */
public final class SkusListSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/Skus_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Skus_List.json
*/
/**
* Sample code: Skus_List.
Expand All @@ -671,7 +672,7 @@ import com.azure.core.util.Context;
/** Samples for StorageTargetOperation Flush. */
public final class StorageTargetOperationFlushSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_Flush.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Flush.json
*/
/**
* Sample code: StorageTargets_Flush.
Expand All @@ -684,6 +685,27 @@ public final class StorageTargetOperationFlushSamples {
}
```

### StorageTargetOperation_Invalidate

```java
import com.azure.core.util.Context;

/** Samples for StorageTargetOperation Invalidate. */
public final class StorageTargetOperationInvalidateSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Invalidate.json
*/
/**
* Sample code: StorageTargets_Invalidate.
*
* @param manager Entry point to StorageCacheManager.
*/
public static void storageTargetsInvalidate(com.azure.resourcemanager.storagecache.StorageCacheManager manager) {
manager.storageTargetOperations().invalidate("scgroup", "sc", "st1", Context.NONE);
}
}
```

### StorageTargetOperation_Resume

```java
Expand All @@ -692,7 +714,7 @@ import com.azure.core.util.Context;
/** Samples for StorageTargetOperation Resume. */
public final class StorageTargetOperationResumeSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_Resume.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Resume.json
*/
/**
* Sample code: StorageTargets_Resume.
Expand All @@ -713,7 +735,7 @@ import com.azure.core.util.Context;
/** Samples for StorageTargetOperation Suspend. */
public final class StorageTargetOperationSuspendSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_Suspend.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Suspend.json
*/
/**
* Sample code: StorageTargets_Suspend.
Expand All @@ -738,7 +760,7 @@ import java.util.Arrays;
/** Samples for StorageTargets CreateOrUpdate. */
public final class StorageTargetsCreateOrUpdateSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_CreateOrUpdate.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate.json
*/
/**
* Sample code: StorageTargets_CreateOrUpdate.
Expand Down Expand Up @@ -770,7 +792,7 @@ public final class StorageTargetsCreateOrUpdateSamples {
}

/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json
*/
/**
* Sample code: StorageTargets_CreateOrUpdate_BlobNfs.
Expand All @@ -794,7 +816,7 @@ public final class StorageTargetsCreateOrUpdateSamples {
}

/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json
*/
/**
* Sample code: StorageTargets_CreateOrUpdate_NoJunctions.
Expand Down Expand Up @@ -822,7 +844,7 @@ import com.azure.core.util.Context;
/** Samples for StorageTargets Delete. */
public final class StorageTargetsDeleteSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_Delete.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Delete.json
*/
/**
* Sample code: StorageTargets_Delete.
Expand All @@ -843,7 +865,7 @@ import com.azure.core.util.Context;
/** Samples for StorageTargets DnsRefresh. */
public final class StorageTargetsDnsRefreshSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_DnsRefresh.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_DnsRefresh.json
*/
/**
* Sample code: Caches_DnsRefresh.
Expand All @@ -864,7 +886,7 @@ import com.azure.core.util.Context;
/** Samples for StorageTargets Get. */
public final class StorageTargetsGetSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_Get.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Get.json
*/
/**
* Sample code: StorageTargets_Get.
Expand All @@ -885,7 +907,7 @@ import com.azure.core.util.Context;
/** Samples for StorageTargets ListByCache. */
public final class StorageTargetsListByCacheSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/StorageTargets_ListByCache.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_ListByCache.json
*/
/**
* Sample code: StorageTargets_List.
Expand All @@ -906,7 +928,7 @@ import com.azure.core.util.Context;
/** Samples for UsageModels List. */
public final class UsageModelsListSamples {
/*
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2021-09-01/examples/UsageModels_List.json
* x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/UsageModels_List.json
*/
/**
* Sample code: UsageModels_List.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for StorageCache Management</name>
<description>This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2021-09.</description>
<description>This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2022-01.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
Expand Down Expand Up @@ -41,6 +42,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* Entry point to StorageCacheManager. A Storage Cache provides scalable caching service for NAS clients, serving data
Expand Down Expand Up @@ -198,7 +200,7 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile
.append("-")
.append("com.azure.resourcemanager.storagecache")
.append("/")
.append("1.0.0-beta.4");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -221,11 +223,24 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies);
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
Expand Down
Loading

0 comments on commit e18f449

Please sign in to comment.