Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.6 (Unreleased)
## 1.0.0-beta.1 (2022-06-08)

- 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-05. 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
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-2022-01. 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-05. 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.5</version>
<version>1.0.0-beta.6</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
222 changes: 193 additions & 29 deletions sdk/storagecache/azure-resourcemanager-storagecache/SAMPLE.md

Large diffs are not rendered by default.

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-2022-01.</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-05.</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 @@ -10,11 +10,13 @@
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.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
Expand Down Expand Up @@ -95,6 +97,19 @@ public static StorageCacheManager authenticate(TokenCredential credential, Azure
return configure().authenticate(credential, profile);
}

/**
* Creates an instance of StorageCache service API entry point.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the StorageCache service API instance.
*/
public static StorageCacheManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new StorageCacheManager(httpPipeline, profile, null);
}

/**
* Gets a Configurable instance that can be used to create StorageCacheManager with optional configuration.
*
Expand All @@ -113,6 +128,7 @@ public static final class Configurable {
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
private final List<String> scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private RetryOptions retryOptions;
private Duration defaultPollInterval;

private Configurable() {
Expand Down Expand Up @@ -173,6 +189,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
*/
public Configurable withRetryOptions(RetryOptions retryOptions) {
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
return this;
}

/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
Expand Down Expand Up @@ -206,7 +235,7 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile
.append("-")
.append("com.azure.resourcemanager.storagecache")
.append("/")
.append("1.0.0-beta.5");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -224,10 +253,15 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
if (retryOptions != null) {
retryPolicy = new RetryPolicy(retryOptions);
} else {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
Expand Down Expand Up @@ -258,63 +292,95 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile
}
}

/** @return Resource collection API of Operations. */
/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/** @return Resource collection API of Skus. */
/**
* Gets the resource collection API of Skus.
*
* @return Resource collection API of Skus.
*/
public Skus skus() {
if (this.skus == null) {
this.skus = new SkusImpl(clientObject.getSkus(), this);
}
return skus;
}

/** @return Resource collection API of UsageModels. */
/**
* Gets the resource collection API of UsageModels.
*
* @return Resource collection API of UsageModels.
*/
public UsageModels usageModels() {
if (this.usageModels == null) {
this.usageModels = new UsageModelsImpl(clientObject.getUsageModels(), this);
}
return usageModels;
}

/** @return Resource collection API of AscOperations. */
/**
* Gets the resource collection API of AscOperations.
*
* @return Resource collection API of AscOperations.
*/
public AscOperations ascOperations() {
if (this.ascOperations == null) {
this.ascOperations = new AscOperationsImpl(clientObject.getAscOperations(), this);
}
return ascOperations;
}

/** @return Resource collection API of AscUsages. */
/**
* Gets the resource collection API of AscUsages.
*
* @return Resource collection API of AscUsages.
*/
public AscUsages ascUsages() {
if (this.ascUsages == null) {
this.ascUsages = new AscUsagesImpl(clientObject.getAscUsages(), this);
}
return ascUsages;
}

/** @return Resource collection API of Caches. */
/**
* Gets the resource collection API of Caches. It manages Cache.
*
* @return Resource collection API of Caches.
*/
public Caches caches() {
if (this.caches == null) {
this.caches = new CachesImpl(clientObject.getCaches(), this);
}
return caches;
}

/** @return Resource collection API of StorageTargets. */
/**
* Gets the resource collection API of StorageTargets. It manages StorageTarget.
*
* @return Resource collection API of StorageTargets.
*/
public StorageTargets storageTargets() {
if (this.storageTargets == null) {
this.storageTargets = new StorageTargetsImpl(clientObject.getStorageTargets(), this);
}
return storageTargets;
}

/** @return Resource collection API of StorageTargetOperations. */
/**
* Gets the resource collection API of StorageTargetOperations.
*
* @return Resource collection API of StorageTargetOperations.
*/
public StorageTargetOperations storageTargetOperations() {
if (this.storageTargetOperations == null) {
this.storageTargetOperations =
Expand Down
Loading