Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-resourcemanager-consumption] SIG replication to edge zones #11415

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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,7 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2021-11-11)

- Azure Resource Manager Consumption client library for Java. This package contains Microsoft Azure SDK for Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## 1.0.0-beta.2 (2021-07-09)

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

Azure Resource Manager Consumption client library for Java.

This package contains Microsoft Azure SDK for Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2019-10. 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 Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. 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-consumption</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
1,911 changes: 1,866 additions & 45 deletions sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md

Large diffs are not rendered by default.

15 changes: 5 additions & 10 deletions sdk/consumption/azure-resourcemanager-consumption/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 Consumption Management</name>
<description>This package contains Microsoft Azure SDK for Consumption Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2019-10.</description>
<description>This package contains Microsoft Azure SDK for Consumption Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand All @@ -38,7 +38,10 @@
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
<jacoco.skip>true</jacoco.skip>
<codesnippet.skip>false</codesnippet.skip>
<javadocDoclet></javadocDoclet>
<javadocDocletOptions></javadocDocletOptions>
</properties>
<dependencies>
<dependency>
Expand All @@ -54,14 +57,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} -->
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.revapi</groupId>
<artifactId>revapi-maven-plugin</artifactId>
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 All @@ -28,7 +29,6 @@
import com.azure.resourcemanager.consumption.implementation.ConsumptionManagementClientBuilder;
import com.azure.resourcemanager.consumption.implementation.CreditsImpl;
import com.azure.resourcemanager.consumption.implementation.EventsOperationsImpl;
import com.azure.resourcemanager.consumption.implementation.ForecastsImpl;
import com.azure.resourcemanager.consumption.implementation.LotsOperationsImpl;
import com.azure.resourcemanager.consumption.implementation.MarketplacesImpl;
import com.azure.resourcemanager.consumption.implementation.OperationsImpl;
Expand All @@ -46,7 +46,6 @@
import com.azure.resourcemanager.consumption.models.Charges;
import com.azure.resourcemanager.consumption.models.Credits;
import com.azure.resourcemanager.consumption.models.EventsOperations;
import com.azure.resourcemanager.consumption.models.Forecasts;
import com.azure.resourcemanager.consumption.models.LotsOperations;
import com.azure.resourcemanager.consumption.models.Marketplaces;
import com.azure.resourcemanager.consumption.models.Operations;
Expand All @@ -63,6 +62,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* Entry point to ConsumptionManager. Consumption management client provides access to consumption resources for Azure
Expand Down Expand Up @@ -93,8 +93,6 @@ public final class ConsumptionManager {

private PriceSheets priceSheets;

private Forecasts forecasts;

private Operations operations;

private AggregatedCosts aggregatedCosts;
Expand Down Expand Up @@ -241,7 +239,7 @@ public ConsumptionManager authenticate(TokenCredential credential, AzureProfile
.append("-")
.append("com.azure.resourcemanager.consumption")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -264,11 +262,24 @@ public ConsumptionManager 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 Expand Up @@ -379,14 +390,6 @@ public PriceSheets priceSheets() {
return priceSheets;
}

/** @return Resource collection API of Forecasts. */
public Forecasts forecasts() {
if (this.forecasts == null) {
this.forecasts = new ForecastsImpl(clientObject.getForecasts(), this);
}
return forecasts;
}

/** @return Resource collection API of Operations. */
public Operations operations() {
if (this.operations == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@ public interface ConsumptionManagementClient {
*/
PriceSheetsClient getPriceSheets();

/**
* Gets the ForecastsClient object to access its operations.
*
* @return the ForecastsClient object.
*/
ForecastsClient getForecasts();

/**
* Gets the OperationsClient object to access its operations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,27 @@ public interface CreditsClient {
/**
* The credit summary by billingAccountId and billingProfileId.
*
* @param scope The scope associated with credits operations. This includes
* '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for
* Billing Profile scope, and
* 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for
* partners.
* @param billingAccountId BillingAccount ID.
* @param billingProfileId Azure Billing Profile ID.
* @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 a credit summary resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
CreditSummaryInner get(String scope);
CreditSummaryInner get(String billingAccountId, String billingProfileId);

/**
* The credit summary by billingAccountId and billingProfileId.
*
* @param scope The scope associated with credits operations. This includes
* '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for
* Billing Profile scope, and
* 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for
* partners.
* @param billingAccountId BillingAccount ID.
* @param billingProfileId Azure Billing Profile ID.
* @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 a credit summary resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<CreditSummaryInner> getWithResponse(String scope, Context context);
Response<CreditSummaryInner> getWithResponse(String billingAccountId, String billingProfileId, Context context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,67 @@
/** An instance of this class provides access to all the operations defined in EventsOperationsClient. */
public interface EventsOperationsClient {
/**
* Lists the events by billingAccountId and billingProfileId for given start and end date.
* Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or
* a billing profile for a given start and end date.
*
* @param billingAccountId BillingAccount ID.
* @param billingProfileId Azure Billing Profile ID.
* @param startDate Start date.
* @param endDate End date.
* @param scope The scope associated with events operations. This includes
* '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for
* Billing Profile scope, and
* 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for
* partners.
* @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 result of listing event summary.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<EventSummaryInner> list(String startDate, String endDate, String scope);
PagedIterable<EventSummaryInner> listByBillingProfile(
String billingAccountId, String billingProfileId, String startDate, String endDate);

/**
* Lists the events by billingAccountId and billingProfileId for given start and end date.
* Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or
* a billing profile for a given start and end date.
*
* @param billingAccountId BillingAccount ID.
* @param billingProfileId Azure Billing Profile ID.
* @param startDate Start date.
* @param endDate End date.
* @param scope The scope associated with events operations. This includes
* '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for
* Billing Profile scope, and
* 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for
* partners.
* @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 result of listing event summary.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<EventSummaryInner> list(String startDate, String endDate, String scope, Context context);
PagedIterable<EventSummaryInner> listByBillingProfile(
String billingAccountId, String billingProfileId, String startDate, String endDate, Context context);

/**
* Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or
* a billing profile for a given start and end date.
*
* @param billingAccountId BillingAccount ID.
* @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 result of listing event summary.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<EventSummaryInner> listByBillingAccount(String billingAccountId);

/**
* Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or
* a billing profile for a given start and end date.
*
* @param billingAccountId BillingAccount ID.
* @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt',
* 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair
* string where key and value is separated by a colon (:).
* @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 result of listing event summary.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<EventSummaryInner> listByBillingAccount(String billingAccountId, String filter, Context context);
}

This file was deleted.

Loading