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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion sdk/avs/azure-resourcemanager-avs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.4 (Unreleased)
## 1.0.0-beta.1 (2022-10-12)

- Azure Resource Manager Avs client library for Java. This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package tag package-2022-05-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/avs/azure-resourcemanager-avs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager Avs client library for Java.

This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package tag package-2021-12-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 Avs Management SDK. Azure VMware Solution API. Package tag package-2022-05-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-avs</artifactId>
<version>1.0.0-beta.3</version>
<version>1.0.0-beta.4</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
357 changes: 245 additions & 112 deletions sdk/avs/azure-resourcemanager-avs/SAMPLE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/avs/azure-resourcemanager-avs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Avs Management</name>
<description>This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package tag package-2021-12-01.</description>
<description>This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package tag package-2022-05-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 @@ -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 @@ -123,6 +125,19 @@ public static AvsManager authenticate(TokenCredential credential, AzureProfile p
return configure().authenticate(credential, profile);
}

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

/**
* Gets a Configurable instance that can be used to create AvsManager with optional configuration.
*
Expand All @@ -134,13 +149,14 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
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 @@ -201,16 +217,31 @@ 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.
*
* @param defaultPollInterval the default poll interval.
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand All @@ -232,7 +263,7 @@ public AvsManager authenticate(TokenCredential credential, AzureProfile profile)
.append("-")
.append("com.azure.resourcemanager.avs")
.append("/")
.append("1.0.0-beta.3");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -250,10 +281,15 @@ public AvsManager authenticate(TokenCredential credential, AzureProfile profile)
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 @@ -284,63 +320,95 @@ public AvsManager authenticate(TokenCredential credential, AzureProfile profile)
}
}

/** @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 Locations. */
/**
* Gets the resource collection API of Locations.
*
* @return Resource collection API of Locations.
*/
public Locations locations() {
if (this.locations == null) {
this.locations = new LocationsImpl(clientObject.getLocations(), this);
}
return locations;
}

/** @return Resource collection API of PrivateClouds. */
/**
* Gets the resource collection API of PrivateClouds. It manages PrivateCloud.
*
* @return Resource collection API of PrivateClouds.
*/
public PrivateClouds privateClouds() {
if (this.privateClouds == null) {
this.privateClouds = new PrivateCloudsImpl(clientObject.getPrivateClouds(), this);
}
return privateClouds;
}

/** @return Resource collection API of Clusters. */
/**
* Gets the resource collection API of Clusters. It manages Cluster.
*
* @return Resource collection API of Clusters.
*/
public Clusters clusters() {
if (this.clusters == null) {
this.clusters = new ClustersImpl(clientObject.getClusters(), this);
}
return clusters;
}

/** @return Resource collection API of Datastores. */
/**
* Gets the resource collection API of Datastores. It manages Datastore.
*
* @return Resource collection API of Datastores.
*/
public Datastores datastores() {
if (this.datastores == null) {
this.datastores = new DatastoresImpl(clientObject.getDatastores(), this);
}
return datastores;
}

/** @return Resource collection API of HcxEnterpriseSites. */
/**
* Gets the resource collection API of HcxEnterpriseSites. It manages HcxEnterpriseSite.
*
* @return Resource collection API of HcxEnterpriseSites.
*/
public HcxEnterpriseSites hcxEnterpriseSites() {
if (this.hcxEnterpriseSites == null) {
this.hcxEnterpriseSites = new HcxEnterpriseSitesImpl(clientObject.getHcxEnterpriseSites(), this);
}
return hcxEnterpriseSites;
}

/** @return Resource collection API of Authorizations. */
/**
* Gets the resource collection API of Authorizations. It manages ExpressRouteAuthorization.
*
* @return Resource collection API of Authorizations.
*/
public Authorizations authorizations() {
if (this.authorizations == null) {
this.authorizations = new AuthorizationsImpl(clientObject.getAuthorizations(), this);
}
return authorizations;
}

/** @return Resource collection API of GlobalReachConnections. */
/**
* Gets the resource collection API of GlobalReachConnections. It manages GlobalReachConnection.
*
* @return Resource collection API of GlobalReachConnections.
*/
public GlobalReachConnections globalReachConnections() {
if (this.globalReachConnections == null) {
this.globalReachConnections =
Expand All @@ -349,63 +417,97 @@ public GlobalReachConnections globalReachConnections() {
return globalReachConnections;
}

/** @return Resource collection API of WorkloadNetworks. */
/**
* Gets the resource collection API of WorkloadNetworks. It manages WorkloadNetworkSegment, WorkloadNetworkDhcp,
* WorkloadNetworkPortMirroring, WorkloadNetworkVMGroup, WorkloadNetworkDnsService, WorkloadNetworkDnsZone,
* WorkloadNetworkPublicIp.
*
* @return Resource collection API of WorkloadNetworks.
*/
public WorkloadNetworks workloadNetworks() {
if (this.workloadNetworks == null) {
this.workloadNetworks = new WorkloadNetworksImpl(clientObject.getWorkloadNetworks(), this);
}
return workloadNetworks;
}

/** @return Resource collection API of CloudLinks. */
/**
* Gets the resource collection API of CloudLinks. It manages CloudLink.
*
* @return Resource collection API of CloudLinks.
*/
public CloudLinks cloudLinks() {
if (this.cloudLinks == null) {
this.cloudLinks = new CloudLinksImpl(clientObject.getCloudLinks(), this);
}
return cloudLinks;
}

/** @return Resource collection API of Addons. */
/**
* Gets the resource collection API of Addons. It manages Addon.
*
* @return Resource collection API of Addons.
*/
public Addons addons() {
if (this.addons == null) {
this.addons = new AddonsImpl(clientObject.getAddons(), this);
}
return addons;
}

/** @return Resource collection API of VirtualMachines. */
/**
* Gets the resource collection API of VirtualMachines.
*
* @return Resource collection API of VirtualMachines.
*/
public VirtualMachines virtualMachines() {
if (this.virtualMachines == null) {
this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this);
}
return virtualMachines;
}

/** @return Resource collection API of PlacementPolicies. */
/**
* Gets the resource collection API of PlacementPolicies. It manages PlacementPolicy.
*
* @return Resource collection API of PlacementPolicies.
*/
public PlacementPolicies placementPolicies() {
if (this.placementPolicies == null) {
this.placementPolicies = new PlacementPoliciesImpl(clientObject.getPlacementPolicies(), this);
}
return placementPolicies;
}

/** @return Resource collection API of ScriptPackages. */
/**
* Gets the resource collection API of ScriptPackages.
*
* @return Resource collection API of ScriptPackages.
*/
public ScriptPackages scriptPackages() {
if (this.scriptPackages == null) {
this.scriptPackages = new ScriptPackagesImpl(clientObject.getScriptPackages(), this);
}
return scriptPackages;
}

/** @return Resource collection API of ScriptCmdlets. */
/**
* Gets the resource collection API of ScriptCmdlets.
*
* @return Resource collection API of ScriptCmdlets.
*/
public ScriptCmdlets scriptCmdlets() {
if (this.scriptCmdlets == null) {
this.scriptCmdlets = new ScriptCmdletsImpl(clientObject.getScriptCmdlets(), this);
}
return scriptCmdlets;
}

/** @return Resource collection API of ScriptExecutions. */
/**
* Gets the resource collection API of ScriptExecutions. It manages ScriptExecution.
*
* @return Resource collection API of ScriptExecutions.
*/
public ScriptExecutions scriptExecutions() {
if (this.scriptExecutions == null) {
this.scriptExecutions = new ScriptExecutionsImpl(clientObject.getScriptExecutions(), this);
Expand Down
Loading