Class AutoscalingPolicyServiceClient (4.0.0)

public abstract class AutoscalingPolicyServiceClient

AutoscalingPolicyService client wrapper, for convenient use.

Inheritance

Object > AutoscalingPolicyServiceClient

Namespace

Google.Cloud.Dataproc.V1

Assembly

Google.Cloud.Dataproc.V1.dll

Remarks

The API interface for managing autoscaling policies in the Dataproc API.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the AutoscalingPolicyService service, which is a host of "dataproc.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default AutoscalingPolicyService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default AutoscalingPolicyService scopes are:

GrpcClient

public virtual AutoscalingPolicyService.AutoscalingPolicyServiceClient GrpcClient { get; }

The underlying gRPC AutoscalingPolicyService client

Property Value
TypeDescription
AutoscalingPolicyService.AutoscalingPolicyServiceClient

Methods

Create()

public static AutoscalingPolicyServiceClient Create()

Synchronously creates a AutoscalingPolicyServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AutoscalingPolicyServiceClientBuilder.

Returns
TypeDescription
AutoscalingPolicyServiceClient

The created AutoscalingPolicyServiceClient.

CreateAsync(CancellationToken)

public static Task<AutoscalingPolicyServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a AutoscalingPolicyServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AutoscalingPolicyServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<AutoscalingPolicyServiceClient>

The task representing the created AutoscalingPolicyServiceClient.

CreateAutoscalingPolicy(LocationName, AutoscalingPolicy, CallSettings)

public virtual AutoscalingPolicy CreateAutoscalingPolicy(LocationName parent, AutoscalingPolicy policy, CallSettings callSettings = null)

Creates new autoscaling policy.

Parameters
NameDescription
parentLocationName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(parent, policy);

CreateAutoscalingPolicy(CreateAutoscalingPolicyRequest, CallSettings)

public virtual AutoscalingPolicy CreateAutoscalingPolicy(CreateAutoscalingPolicyRequest request, CallSettings callSettings = null)

Creates new autoscaling policy.

Parameters
NameDescription
requestCreateAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Policy = new AutoscalingPolicy(),
};
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(request);

CreateAutoscalingPolicy(RegionName, AutoscalingPolicy, CallSettings)

public virtual AutoscalingPolicy CreateAutoscalingPolicy(RegionName parent, AutoscalingPolicy policy, CallSettings callSettings = null)

Creates new autoscaling policy.

Parameters
NameDescription
parentRegionName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]");
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(parent, policy);

CreateAutoscalingPolicy(String, AutoscalingPolicy, CallSettings)

public virtual AutoscalingPolicy CreateAutoscalingPolicy(string parent, AutoscalingPolicy policy, CallSettings callSettings = null)

Creates new autoscaling policy.

Parameters
NameDescription
parentString

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(parent, policy);

CreateAutoscalingPolicyAsync(LocationName, AutoscalingPolicy, CallSettings)

public virtual Task<AutoscalingPolicy> CreateAutoscalingPolicyAsync(LocationName parent, AutoscalingPolicy policy, CallSettings callSettings = null)

Creates new autoscaling policy.

Parameters
NameDescription
parentLocationName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy);

CreateAutoscalingPolicyAsync(LocationName, AutoscalingPolicy, CancellationToken)

public virtual Task<AutoscalingPolicy> CreateAutoscalingPolicyAsync(LocationName parent, AutoscalingPolicy policy, CancellationToken cancellationToken)

Creates new autoscaling policy.

Parameters
NameDescription
parentLocationName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy);

CreateAutoscalingPolicyAsync(CreateAutoscalingPolicyRequest, CallSettings)

public virtual Task<AutoscalingPolicy> CreateAutoscalingPolicyAsync(CreateAutoscalingPolicyRequest request, CallSettings callSettings = null)

Creates new autoscaling policy.

Parameters
NameDescription
requestCreateAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Policy = new AutoscalingPolicy(),
};
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(request);

CreateAutoscalingPolicyAsync(CreateAutoscalingPolicyRequest, CancellationToken)

public virtual Task<AutoscalingPolicy> CreateAutoscalingPolicyAsync(CreateAutoscalingPolicyRequest request, CancellationToken cancellationToken)

Creates new autoscaling policy.

Parameters
NameDescription
requestCreateAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Policy = new AutoscalingPolicy(),
};
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(request);

CreateAutoscalingPolicyAsync(RegionName, AutoscalingPolicy, CallSettings)

public virtual Task<AutoscalingPolicy> CreateAutoscalingPolicyAsync(RegionName parent, AutoscalingPolicy policy, CallSettings callSettings = null)

Creates new autoscaling policy.

Parameters
NameDescription
parentRegionName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]");
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy);

CreateAutoscalingPolicyAsync(RegionName, AutoscalingPolicy, CancellationToken)

public virtual Task<AutoscalingPolicy> CreateAutoscalingPolicyAsync(RegionName parent, AutoscalingPolicy policy, CancellationToken cancellationToken)

Creates new autoscaling policy.

Parameters
NameDescription
parentRegionName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]");
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy);

CreateAutoscalingPolicyAsync(String, AutoscalingPolicy, CallSettings)

public virtual Task<AutoscalingPolicy> CreateAutoscalingPolicyAsync(string parent, AutoscalingPolicy policy, CallSettings callSettings = null)

Creates new autoscaling policy.

Parameters
NameDescription
parentString

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy);

CreateAutoscalingPolicyAsync(String, AutoscalingPolicy, CancellationToken)

public virtual Task<AutoscalingPolicy> CreateAutoscalingPolicyAsync(string parent, AutoscalingPolicy policy, CancellationToken cancellationToken)

Creates new autoscaling policy.

Parameters
NameDescription
parentString

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}

policyAutoscalingPolicy

Required. The autoscaling policy to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy);

DeleteAutoscalingPolicy(AutoscalingPolicyName, CallSettings)

public virtual void DeleteAutoscalingPolicy(AutoscalingPolicyName name, CallSettings callSettings = null)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
nameAutoscalingPolicyName

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
// Make the request
autoscalingPolicyServiceClient.DeleteAutoscalingPolicy(name);

DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest, CallSettings)

public virtual void DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request, CallSettings callSettings = null)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
requestDeleteAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest
{
    AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"),
};
// Make the request
autoscalingPolicyServiceClient.DeleteAutoscalingPolicy(request);

DeleteAutoscalingPolicy(String, CallSettings)

public virtual void DeleteAutoscalingPolicy(string name, CallSettings callSettings = null)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
nameString

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]";
// Make the request
autoscalingPolicyServiceClient.DeleteAutoscalingPolicy(name);

DeleteAutoscalingPolicyAsync(AutoscalingPolicyName, CallSettings)

public virtual Task DeleteAutoscalingPolicyAsync(AutoscalingPolicyName name, CallSettings callSettings = null)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
nameAutoscalingPolicyName

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
// Make the request
await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(name);

DeleteAutoscalingPolicyAsync(AutoscalingPolicyName, CancellationToken)

public virtual Task DeleteAutoscalingPolicyAsync(AutoscalingPolicyName name, CancellationToken cancellationToken)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
nameAutoscalingPolicyName

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
// Make the request
await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(name);

DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest, CallSettings)

public virtual Task DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest request, CallSettings callSettings = null)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
requestDeleteAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest
{
    AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"),
};
// Make the request
await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(request);

DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest, CancellationToken)

public virtual Task DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest request, CancellationToken cancellationToken)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
requestDeleteAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest
{
    AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"),
};
// Make the request
await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(request);

DeleteAutoscalingPolicyAsync(String, CallSettings)

public virtual Task DeleteAutoscalingPolicyAsync(string name, CallSettings callSettings = null)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
nameString

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]";
// Make the request
await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(name);

DeleteAutoscalingPolicyAsync(String, CancellationToken)

public virtual Task DeleteAutoscalingPolicyAsync(string name, CancellationToken cancellationToken)

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
nameString

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]";
// Make the request
await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(name);

GetAutoscalingPolicy(AutoscalingPolicyName, CallSettings)

public virtual AutoscalingPolicy GetAutoscalingPolicy(AutoscalingPolicyName name, CallSettings callSettings = null)

Retrieves autoscaling policy.

Parameters
NameDescription
nameAutoscalingPolicyName

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.GetAutoscalingPolicy(name);

GetAutoscalingPolicy(GetAutoscalingPolicyRequest, CallSettings)

public virtual AutoscalingPolicy GetAutoscalingPolicy(GetAutoscalingPolicyRequest request, CallSettings callSettings = null)

Retrieves autoscaling policy.

Parameters
NameDescription
requestGetAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
GetAutoscalingPolicyRequest request = new GetAutoscalingPolicyRequest
{
    AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"),
};
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.GetAutoscalingPolicy(request);

GetAutoscalingPolicy(String, CallSettings)

public virtual AutoscalingPolicy GetAutoscalingPolicy(string name, CallSettings callSettings = null)

Retrieves autoscaling policy.

Parameters
NameDescription
nameString

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]";
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.GetAutoscalingPolicy(name);

GetAutoscalingPolicyAsync(AutoscalingPolicyName, CallSettings)

public virtual Task<AutoscalingPolicy> GetAutoscalingPolicyAsync(AutoscalingPolicyName name, CallSettings callSettings = null)

Retrieves autoscaling policy.

Parameters
NameDescription
nameAutoscalingPolicyName

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.GetAutoscalingPolicyAsync(name);

GetAutoscalingPolicyAsync(AutoscalingPolicyName, CancellationToken)

public virtual Task<AutoscalingPolicy> GetAutoscalingPolicyAsync(AutoscalingPolicyName name, CancellationToken cancellationToken)

Retrieves autoscaling policy.

Parameters
NameDescription
nameAutoscalingPolicyName

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
AutoscalingPolicyName name = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.GetAutoscalingPolicyAsync(name);

GetAutoscalingPolicyAsync(GetAutoscalingPolicyRequest, CallSettings)

public virtual Task<AutoscalingPolicy> GetAutoscalingPolicyAsync(GetAutoscalingPolicyRequest request, CallSettings callSettings = null)

Retrieves autoscaling policy.

Parameters
NameDescription
requestGetAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
GetAutoscalingPolicyRequest request = new GetAutoscalingPolicyRequest
{
    AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"),
};
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.GetAutoscalingPolicyAsync(request);

GetAutoscalingPolicyAsync(GetAutoscalingPolicyRequest, CancellationToken)

public virtual Task<AutoscalingPolicy> GetAutoscalingPolicyAsync(GetAutoscalingPolicyRequest request, CancellationToken cancellationToken)

Retrieves autoscaling policy.

Parameters
NameDescription
requestGetAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
GetAutoscalingPolicyRequest request = new GetAutoscalingPolicyRequest
{
    AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"),
};
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.GetAutoscalingPolicyAsync(request);

GetAutoscalingPolicyAsync(String, CallSettings)

public virtual Task<AutoscalingPolicy> GetAutoscalingPolicyAsync(string name, CallSettings callSettings = null)

Retrieves autoscaling policy.

Parameters
NameDescription
nameString

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]";
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.GetAutoscalingPolicyAsync(name);

GetAutoscalingPolicyAsync(String, CancellationToken)

public virtual Task<AutoscalingPolicy> GetAutoscalingPolicyAsync(string name, CancellationToken cancellationToken)

Retrieves autoscaling policy.

Parameters
NameDescription
nameString

Required. The "resource name" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}

  • For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/autoscalingPolicies/[AUTOSCALING_POLICY]";
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.GetAutoscalingPolicyAsync(name);

ListAutoscalingPolicies(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> ListAutoscalingPolicies(LocationName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists autoscaling policies in the project.

Parameters
NameDescription
parentLocationName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy>

A pageable sequence of AutoscalingPolicy resources.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AutoscalingPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAutoscalingPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AutoscalingPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AutoscalingPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AutoscalingPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAutoscalingPolicies(ListAutoscalingPoliciesRequest, CallSettings)

public virtual PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> ListAutoscalingPolicies(ListAutoscalingPoliciesRequest request, CallSettings callSettings = null)

Lists autoscaling policies in the project.

Parameters
NameDescription
requestListAutoscalingPoliciesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy>

A pageable sequence of AutoscalingPolicy resources.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
ListAutoscalingPoliciesRequest request = new ListAutoscalingPoliciesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPolicies(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (AutoscalingPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAutoscalingPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AutoscalingPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AutoscalingPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AutoscalingPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAutoscalingPolicies(RegionName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> ListAutoscalingPolicies(RegionName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists autoscaling policies in the project.

Parameters
NameDescription
parentRegionName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy>

A pageable sequence of AutoscalingPolicy resources.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]");
// Make the request
PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AutoscalingPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAutoscalingPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AutoscalingPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AutoscalingPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AutoscalingPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAutoscalingPolicies(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> ListAutoscalingPolicies(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists autoscaling policies in the project.

Parameters
NameDescription
parentString

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy>

A pageable sequence of AutoscalingPolicy resources.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (AutoscalingPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAutoscalingPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AutoscalingPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AutoscalingPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AutoscalingPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAutoscalingPoliciesAsync(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> ListAutoscalingPoliciesAsync(LocationName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists autoscaling policies in the project.

Parameters
NameDescription
parentLocationName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy>

A pageable asynchronous sequence of AutoscalingPolicy resources.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AutoscalingPolicy item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAutoscalingPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AutoscalingPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AutoscalingPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AutoscalingPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAutoscalingPoliciesAsync(ListAutoscalingPoliciesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> ListAutoscalingPoliciesAsync(ListAutoscalingPoliciesRequest request, CallSettings callSettings = null)

Lists autoscaling policies in the project.

Parameters
NameDescription
requestListAutoscalingPoliciesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy>

A pageable asynchronous sequence of AutoscalingPolicy resources.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
ListAutoscalingPoliciesRequest request = new ListAutoscalingPoliciesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPoliciesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AutoscalingPolicy item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAutoscalingPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AutoscalingPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AutoscalingPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AutoscalingPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAutoscalingPoliciesAsync(RegionName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> ListAutoscalingPoliciesAsync(RegionName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists autoscaling policies in the project.

Parameters
NameDescription
parentRegionName

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy>

A pageable asynchronous sequence of AutoscalingPolicy resources.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]");
// Make the request
PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AutoscalingPolicy item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAutoscalingPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AutoscalingPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AutoscalingPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AutoscalingPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListAutoscalingPoliciesAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> ListAutoscalingPoliciesAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)

Lists autoscaling policies in the project.

Parameters
NameDescription
parentString

Required. The "resource name" of the region or location, as described in https://cloud.google.com/apis/design/resource_names.

  • For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region}

  • For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy>

A pageable asynchronous sequence of AutoscalingPolicy resources.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AutoscalingPolicy item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAutoscalingPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (AutoscalingPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AutoscalingPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AutoscalingPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateAutoscalingPolicy(AutoscalingPolicy, CallSettings)

public virtual AutoscalingPolicy UpdateAutoscalingPolicy(AutoscalingPolicy policy, CallSettings callSettings = null)

Updates (replaces) autoscaling policy.

Disabled check for update_mask, because all updates will be full replacements.

Parameters
NameDescription
policyAutoscalingPolicy

Required. The updated autoscaling policy.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.UpdateAutoscalingPolicy(policy);

UpdateAutoscalingPolicy(UpdateAutoscalingPolicyRequest, CallSettings)

public virtual AutoscalingPolicy UpdateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request, CallSettings callSettings = null)

Updates (replaces) autoscaling policy.

Disabled check for update_mask, because all updates will be full replacements.

Parameters
NameDescription
requestUpdateAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
AutoscalingPolicy

The RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create();
// Initialize request argument(s)
UpdateAutoscalingPolicyRequest request = new UpdateAutoscalingPolicyRequest
{
    Policy = new AutoscalingPolicy(),
};
// Make the request
AutoscalingPolicy response = autoscalingPolicyServiceClient.UpdateAutoscalingPolicy(request);

UpdateAutoscalingPolicyAsync(AutoscalingPolicy, CallSettings)

public virtual Task<AutoscalingPolicy> UpdateAutoscalingPolicyAsync(AutoscalingPolicy policy, CallSettings callSettings = null)

Updates (replaces) autoscaling policy.

Disabled check for update_mask, because all updates will be full replacements.

Parameters
NameDescription
policyAutoscalingPolicy

Required. The updated autoscaling policy.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.UpdateAutoscalingPolicyAsync(policy);

UpdateAutoscalingPolicyAsync(AutoscalingPolicy, CancellationToken)

public virtual Task<AutoscalingPolicy> UpdateAutoscalingPolicyAsync(AutoscalingPolicy policy, CancellationToken cancellationToken)

Updates (replaces) autoscaling policy.

Disabled check for update_mask, because all updates will be full replacements.

Parameters
NameDescription
policyAutoscalingPolicy

Required. The updated autoscaling policy.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
AutoscalingPolicy policy = new AutoscalingPolicy();
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.UpdateAutoscalingPolicyAsync(policy);

UpdateAutoscalingPolicyAsync(UpdateAutoscalingPolicyRequest, CallSettings)

public virtual Task<AutoscalingPolicy> UpdateAutoscalingPolicyAsync(UpdateAutoscalingPolicyRequest request, CallSettings callSettings = null)

Updates (replaces) autoscaling policy.

Disabled check for update_mask, because all updates will be full replacements.

Parameters
NameDescription
requestUpdateAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAutoscalingPolicyRequest request = new UpdateAutoscalingPolicyRequest
{
    Policy = new AutoscalingPolicy(),
};
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.UpdateAutoscalingPolicyAsync(request);

UpdateAutoscalingPolicyAsync(UpdateAutoscalingPolicyRequest, CancellationToken)

public virtual Task<AutoscalingPolicy> UpdateAutoscalingPolicyAsync(UpdateAutoscalingPolicyRequest request, CancellationToken cancellationToken)

Updates (replaces) autoscaling policy.

Disabled check for update_mask, because all updates will be full replacements.

Parameters
NameDescription
requestUpdateAutoscalingPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<AutoscalingPolicy>

A Task containing the RPC response.

Example
// Create client
AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAutoscalingPolicyRequest request = new UpdateAutoscalingPolicyRequest
{
    Policy = new AutoscalingPolicy(),
};
// Make the request
AutoscalingPolicy response = await autoscalingPolicyServiceClient.UpdateAutoscalingPolicyAsync(request);