GitHub Repository | Product Reference |
Service Description: The Quotas Adjuster Settings API is an infrastructure service for Google Cloud that lets service consumers view and update their quota adjuster settings.
- Update quota adjuster settings. - Get the name of the configurations.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create()) {
QuotaAdjusterSettings quotaAdjusterSettings = QuotaAdjusterSettings.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
QuotaAdjusterSettings response =
quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings(
quotaAdjusterSettings, updateMask);
}
Note: close() needs to be called on the QuotaAdjusterSettingsManagerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
Method | Description | Method Variants |
---|---|---|
UpdateQuotaAdjusterSettings |
RPC Method for updating QuotaAdjusterSettings based on the request |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetQuotaAdjusterSettings |
RPC Method for getting QuotaAdjusterSettings based on the request |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of QuotaAdjusterSettingsManagerSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings =
QuotaAdjusterSettingsManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings =
QuotaAdjusterSettingsManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
QuotaAdjusterSettingsManagerSettings quotaAdjusterSettingsManagerSettings =
QuotaAdjusterSettingsManagerSettings.newHttpJsonBuilder().build();
QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create(quotaAdjusterSettingsManagerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final QuotaAdjusterSettingsManagerClient create()
Constructs an instance of QuotaAdjusterSettingsManagerClient with default settings.
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettingsManagerClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(QuotaAdjusterSettingsManagerSettings settings)
public static final QuotaAdjusterSettingsManagerClient create(QuotaAdjusterSettingsManagerSettings settings)
Constructs an instance of QuotaAdjusterSettingsManagerClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Parameter | |
---|---|
Name | Description |
settings |
QuotaAdjusterSettingsManagerSettings |
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettingsManagerClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(QuotaAdjusterSettingsManagerStub stub)
public static final QuotaAdjusterSettingsManagerClient create(QuotaAdjusterSettingsManagerStub stub)
Constructs an instance of QuotaAdjusterSettingsManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(QuotaAdjusterSettingsManagerSettings).
Parameter | |
---|---|
Name | Description |
stub |
QuotaAdjusterSettingsManagerStub |
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettingsManagerClient |
Constructors
QuotaAdjusterSettingsManagerClient(QuotaAdjusterSettingsManagerSettings settings)
protected QuotaAdjusterSettingsManagerClient(QuotaAdjusterSettingsManagerSettings settings)
Constructs an instance of QuotaAdjusterSettingsManagerClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Parameter | |
---|---|
Name | Description |
settings |
QuotaAdjusterSettingsManagerSettings |
QuotaAdjusterSettingsManagerClient(QuotaAdjusterSettingsManagerStub stub)
protected QuotaAdjusterSettingsManagerClient(QuotaAdjusterSettingsManagerStub stub)
Parameter | |
---|---|
Name | Description |
stub |
QuotaAdjusterSettingsManagerStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration |
long |
unit |
TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
close()
public final void close()
getQuotaAdjusterSettings(GetQuotaAdjusterSettingsRequest request)
public final QuotaAdjusterSettings getQuotaAdjusterSettings(GetQuotaAdjusterSettingsRequest request)
RPC Method for getting QuotaAdjusterSettings based on the request
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create()) {
GetQuotaAdjusterSettingsRequest request =
GetQuotaAdjusterSettingsRequest.newBuilder()
.setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString())
.build();
QuotaAdjusterSettings response =
quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetQuotaAdjusterSettingsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettings |
getQuotaAdjusterSettings(QuotaAdjusterSettingsName name)
public final QuotaAdjusterSettings getQuotaAdjusterSettings(QuotaAdjusterSettingsName name)
RPC Method for getting QuotaAdjusterSettings based on the request
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create()) {
QuotaAdjusterSettingsName name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]");
QuotaAdjusterSettings response =
quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(name);
}
Parameter | |
---|---|
Name | Description |
name |
QuotaAdjusterSettingsName Required. Name of the config. Required to be “settings”, as only a single setting per container will be supported initially. |
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettings |
getQuotaAdjusterSettings(String name)
public final QuotaAdjusterSettings getQuotaAdjusterSettings(String name)
RPC Method for getting QuotaAdjusterSettings based on the request
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create()) {
String name = QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString();
QuotaAdjusterSettings response =
quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettings(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Name of the config. Required to be “settings”, as only a single setting per container will be supported initially. |
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettings |
getQuotaAdjusterSettingsCallable()
public final UnaryCallable<GetQuotaAdjusterSettingsRequest,QuotaAdjusterSettings> getQuotaAdjusterSettingsCallable()
RPC Method for getting QuotaAdjusterSettings based on the request
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create()) {
GetQuotaAdjusterSettingsRequest request =
GetQuotaAdjusterSettingsRequest.newBuilder()
.setName(QuotaAdjusterSettingsName.of("[PROJECT]", "[LOCATION]").toString())
.build();
ApiFuture<QuotaAdjusterSettings> future =
quotaAdjusterSettingsManagerClient.getQuotaAdjusterSettingsCallable().futureCall(request);
// Do something.
QuotaAdjusterSettings response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetQuotaAdjusterSettingsRequest,QuotaAdjusterSettings> |
getSettings()
public final QuotaAdjusterSettingsManagerSettings getSettings()
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettingsManagerSettings |
getStub()
public QuotaAdjusterSettingsManagerStub getStub()
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettingsManagerStub |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateQuotaAdjusterSettings(QuotaAdjusterSettings quotaAdjusterSettings, FieldMask updateMask)
public final QuotaAdjusterSettings updateQuotaAdjusterSettings(QuotaAdjusterSettings quotaAdjusterSettings, FieldMask updateMask)
RPC Method for updating QuotaAdjusterSettings based on the request
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create()) {
QuotaAdjusterSettings quotaAdjusterSettings = QuotaAdjusterSettings.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
QuotaAdjusterSettings response =
quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings(
quotaAdjusterSettings, updateMask);
}
Parameters | |
---|---|
Name | Description |
quotaAdjusterSettings |
QuotaAdjusterSettings Required. The QuotaAdjusterSettings to update. |
updateMask |
FieldMask Optional. The list of fields to update. |
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettings |
updateQuotaAdjusterSettings(UpdateQuotaAdjusterSettingsRequest request)
public final QuotaAdjusterSettings updateQuotaAdjusterSettings(UpdateQuotaAdjusterSettingsRequest request)
RPC Method for updating QuotaAdjusterSettings based on the request
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create()) {
UpdateQuotaAdjusterSettingsRequest request =
UpdateQuotaAdjusterSettingsRequest.newBuilder()
.setQuotaAdjusterSettings(QuotaAdjusterSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
QuotaAdjusterSettings response =
quotaAdjusterSettingsManagerClient.updateQuotaAdjusterSettings(request);
}
Parameter | |
---|---|
Name | Description |
request |
UpdateQuotaAdjusterSettingsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
QuotaAdjusterSettings |
updateQuotaAdjusterSettingsCallable()
public final UnaryCallable<UpdateQuotaAdjusterSettingsRequest,QuotaAdjusterSettings> updateQuotaAdjusterSettingsCallable()
RPC Method for updating QuotaAdjusterSettings based on the request
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (QuotaAdjusterSettingsManagerClient quotaAdjusterSettingsManagerClient =
QuotaAdjusterSettingsManagerClient.create()) {
UpdateQuotaAdjusterSettingsRequest request =
UpdateQuotaAdjusterSettingsRequest.newBuilder()
.setQuotaAdjusterSettings(QuotaAdjusterSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<QuotaAdjusterSettings> future =
quotaAdjusterSettingsManagerClient
.updateQuotaAdjusterSettingsCallable()
.futureCall(request);
// Do something.
QuotaAdjusterSettings response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UpdateQuotaAdjusterSettingsRequest,QuotaAdjusterSettings> |