Skip to content
Merged
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,7 @@
package com.microsoft.azure.management.batch;

import com.microsoft.azure.management.apigeneration.LangDefinition;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById;
Expand All @@ -23,4 +24,11 @@ public interface BatchAccounts extends
SupportsDeleting,
SupportsDeletingByGroup,
SupportsBatchCreation<BatchAccount> {
/**
* Queries the number of the batch account can be created in specified region`.
*
* @param region the region in for which to check quota
* @return whether the number of batch accounts can be created in specified region.
*/
int getBatchAccountQuotaByLocation(Region region);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.microsoft.azure.management.apigeneration.LangDefinition;
import com.microsoft.azure.management.batch.BatchAccount;
import com.microsoft.azure.management.batch.BatchAccounts;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl;
import com.microsoft.azure.management.storage.implementation.StorageManager;
import rx.Observable;
Expand All @@ -18,12 +19,20 @@ public class BatchAccountsImpl
private final StorageManager storageManager;
private ApplicationsInner applicationsClient;
private ApplicationPackagesInner applicationPackagesClient;
private LocationsInner locationClient;

protected BatchAccountsImpl(BatchAccountsInner innerCollection, BatchManager manager, ApplicationsInner applicationsClient, ApplicationPackagesInner applicationPackagesClient, StorageManager storageManager) {
protected BatchAccountsImpl(
BatchAccountsInner innerCollection,
BatchManager manager,
ApplicationsInner applicationsClient,
ApplicationPackagesInner applicationPackagesClient,
LocationsInner locationClient,
StorageManager storageManager) {
super(innerCollection, manager);
this.storageManager = storageManager;
this.applicationsClient = applicationsClient;
this.applicationPackagesClient = applicationPackagesClient;
this.locationClient = locationClient;
}

@Override
Expand Down Expand Up @@ -76,4 +85,9 @@ public BatchAccount.DefinitionStages.Blank define(String name) {
public BatchAccount getByGroup(String groupName, String name) {
return wrapModel(this.innerCollection.get(groupName, name));
}

@Override
public int getBatchAccountQuotaByLocation(Region region) {
return this.locationClient.getQuotas(region.toString()).accountQuota();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public BatchAccounts batchAccounts() {
this,
super.innerManagementClient.applications(),
super.innerManagementClient.applicationPackages(),
super.innerManagementClient.locations(),
this.storageManager);
}

Expand Down