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
4 changes: 3 additions & 1 deletion sdk/batch/azure-resourcemanager-batch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 1.0.0-beta.1 (2022-05-27)

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

Azure Resource Manager Batch client library for Java.

This package contains Microsoft Azure SDK for Batch Management SDK. Batch Client. 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 Batch Management SDK. Batch Client. Package tag package-2022-06. 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-batch</artifactId>
<version>1.0.0</version>
<version>1.1.0-beta.1</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
166 changes: 97 additions & 69 deletions sdk/batch/azure-resourcemanager-batch/SAMPLE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/batch/azure-resourcemanager-batch/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 Batch Management</name>
<description>This package contains Microsoft Azure SDK for Batch Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Batch Client. Package tag package-2022-01.</description>
<description>This package contains Microsoft Azure SDK for Batch Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Batch Client. Package tag package-2022-06.</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 BatchManager authenticate(TokenCredential credential, AzureProfile
return configure().authenticate(credential, profile);
}

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

/**
* Gets a Configurable instance that can be used to create BatchManager 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 BatchManager authenticate(TokenCredential credential, AzureProfile profil
.append("-")
.append("com.azure.resourcemanager.batch")
.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 @@ -224,10 +253,15 @@ public BatchManager authenticate(TokenCredential credential, AzureProfile profil
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 BatchManager authenticate(TokenCredential credential, AzureProfile profil
}
}

/** @return Resource collection API of BatchAccounts. */
/**
* Gets the resource collection API of BatchAccounts. It manages BatchAccount.
*
* @return Resource collection API of BatchAccounts.
*/
public BatchAccounts batchAccounts() {
if (this.batchAccounts == null) {
this.batchAccounts = new BatchAccountsImpl(clientObject.getBatchAccounts(), this);
}
return batchAccounts;
}

/** @return Resource collection API of ApplicationPackages. */
/**
* Gets the resource collection API of ApplicationPackages. It manages ApplicationPackage.
*
* @return Resource collection API of ApplicationPackages.
*/
public ApplicationPackages applicationPackages() {
if (this.applicationPackages == null) {
this.applicationPackages = new ApplicationPackagesImpl(clientObject.getApplicationPackages(), this);
}
return applicationPackages;
}

/** @return Resource collection API of Applications. */
/**
* Gets the resource collection API of Applications. It manages Application.
*
* @return Resource collection API of Applications.
*/
public Applications applications() {
if (this.applications == null) {
this.applications = new ApplicationsImpl(clientObject.getApplications(), this);
}
return applications;
}

/** @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 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 Certificates. */
/**
* Gets the resource collection API of Certificates. It manages Certificate.
*
* @return Resource collection API of Certificates.
*/
public Certificates certificates() {
if (this.certificates == null) {
this.certificates = new CertificatesImpl(clientObject.getCertificates(), this);
}
return certificates;
}

/** @return Resource collection API of PrivateLinkResources. */
/**
* Gets the resource collection API of PrivateLinkResources.
*
* @return Resource collection API of PrivateLinkResources.
*/
public PrivateLinkResources privateLinkResources() {
if (this.privateLinkResources == null) {
this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this);
}
return privateLinkResources;
}

/** @return Resource collection API of PrivateEndpointConnections. */
/**
* Gets the resource collection API of PrivateEndpointConnections.
*
* @return Resource collection API of PrivateEndpointConnections.
*/
public PrivateEndpointConnections privateEndpointConnections() {
if (this.privateEndpointConnections == null) {
this.privateEndpointConnections =
Expand All @@ -323,7 +389,11 @@ public PrivateEndpointConnections privateEndpointConnections() {
return privateEndpointConnections;
}

/** @return Resource collection API of Pools. */
/**
* Gets the resource collection API of Pools. It manages Pool.
*
* @return Resource collection API of Pools.
*/
public Pools pools() {
if (this.pools == null) {
this.pools = new PoolsImpl(clientObject.getPools(), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,66 @@ PrivateEndpointConnectionInner update(
PrivateEndpointConnectionInner parameters,
String ifMatch,
Context context);

/**
* Deletes the specified private endpoint connection.
*
* @param resourceGroupName The name of the resource group that contains the Batch account.
* @param accountName The name of the Batch account.
* @param privateEndpointConnectionName The private endpoint connection name. This must be unique within the
* account.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String accountName, String privateEndpointConnectionName);

/**
* Deletes the specified private endpoint connection.
*
* @param resourceGroupName The name of the resource group that contains the Batch account.
* @param accountName The name of the Batch account.
* @param privateEndpointConnectionName The private endpoint connection name. This must be unique within the
* account.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context);

/**
* Deletes the specified private endpoint connection.
*
* @param resourceGroupName The name of the resource group that contains the Batch account.
* @param accountName The name of the Batch account.
* @param privateEndpointConnectionName The private endpoint connection name. This must be unique within the
* account.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName);

/**
* Deletes the specified private endpoint connection.
*
* @param resourceGroupName The name of the resource group that contains the Batch account.
* @param accountName The name of the Batch account.
* @param privateEndpointConnectionName The private endpoint connection name. This must be unique within the
* account.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.azure.resourcemanager.batch.models.AutoStorageBaseProperties;
import com.azure.resourcemanager.batch.models.EncryptionProperties;
import com.azure.resourcemanager.batch.models.KeyVaultReference;
import com.azure.resourcemanager.batch.models.NetworkProfile;
import com.azure.resourcemanager.batch.models.PoolAllocationMode;
import com.azure.resourcemanager.batch.models.PublicNetworkAccessType;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -45,6 +46,13 @@ public final class BatchAccountCreateProperties {
@JsonProperty(value = "publicNetworkAccess")
private PublicNetworkAccessType publicNetworkAccess;

/*
* The network profile only takes effect when publicNetworkAccess is
* enabled.
*/
@JsonProperty(value = "networkProfile")
private NetworkProfile networkProfile;

/*
* Configures how customer data is encrypted inside the Batch account. By
* default, accounts are encrypted using a Microsoft managed key. For
Expand Down Expand Up @@ -145,6 +153,26 @@ public BatchAccountCreateProperties withPublicNetworkAccess(PublicNetworkAccessT
return this;
}

/**
* Get the networkProfile property: The network profile only takes effect when publicNetworkAccess is enabled.
*
* @return the networkProfile value.
*/
public NetworkProfile networkProfile() {
return this.networkProfile;
}

/**
* Set the networkProfile property: The network profile only takes effect when publicNetworkAccess is enabled.
*
* @param networkProfile the networkProfile value to set.
* @return the BatchAccountCreateProperties object itself.
*/
public BatchAccountCreateProperties withNetworkProfile(NetworkProfile networkProfile) {
this.networkProfile = networkProfile;
return this;
}

/**
* Get the encryption property: Configures how customer data is encrypted inside the Batch account. By default,
* accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used
Expand Down Expand Up @@ -204,6 +232,9 @@ public void validate() {
if (keyVaultReference() != null) {
keyVaultReference().validate();
}
if (networkProfile() != null) {
networkProfile().validate();
}
if (encryption() != null) {
encryption().validate();
}
Expand Down
Loading