Google Cloud Dataproc v1 API - Class AutoscalingPolicyServiceClient (5.14.0)

public abstract class AutoscalingPolicyServiceClient

Reference documentation and code samples for the Google Cloud Dataproc v1 API 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
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default AutoscalingPolicyService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default AutoscalingPolicyService scopes are:

GrpcClient

public virtual AutoscalingPolicyService.AutoscalingPolicyServiceClient GrpcClient { get; }

The underlying gRPC AutoscalingPolicyService client

Property Value
Type Description
AutoscalingPolicyServiceAutoscalingPolicyServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

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
Type Description
AutoscalingPolicyServiceClient

The created AutoscalingPolicyServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskAutoscalingPolicyServiceClient

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
Name Description
parent LocationName

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request CreateAutoscalingPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
parent RegionName

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
parent string

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
parent LocationName

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
parent LocationName

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
request CreateAutoscalingPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
request CreateAutoscalingPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
parent RegionName

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
parent RegionName

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
parent string

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
parent string

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}

policy AutoscalingPolicy

Required. The autoscaling policy to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
name AutoscalingPolicyName

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}

callSettings CallSettings

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
Name Description
request DeleteAutoscalingPolicyRequest

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

callSettings CallSettings

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
Name Description
name string

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}

callSettings CallSettings

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
Name Description
name AutoscalingPolicyName

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}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name AutoscalingPolicyName

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}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
request DeleteAutoscalingPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request DeleteAutoscalingPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
name string

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}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name string

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}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
name AutoscalingPolicyName

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}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request GetAutoscalingPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name string

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}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name AutoscalingPolicyName

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}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
name AutoscalingPolicyName

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}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
request GetAutoscalingPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
request GetAutoscalingPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
name string

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}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
name string

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}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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, int?, CallSettings)

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

Lists autoscaling policies in the project.

Parameters
Name Description
parent LocationName

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}

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAutoscalingPoliciesResponseAutoscalingPolicy

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
Name Description
request ListAutoscalingPoliciesRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAutoscalingPoliciesResponseAutoscalingPolicy

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, int?, CallSettings)

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

Lists autoscaling policies in the project.

Parameters
Name Description
parent RegionName

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}

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAutoscalingPoliciesResponseAutoscalingPolicy

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, int?, CallSettings)

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

Lists autoscaling policies in the project.

Parameters
Name Description
parent string

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}

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAutoscalingPoliciesResponseAutoscalingPolicy

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, int?, CallSettings)

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

Lists autoscaling policies in the project.

Parameters
Name Description
parent LocationName

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}

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAutoscalingPoliciesResponseAutoscalingPolicy

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
Name Description
request ListAutoscalingPoliciesRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAutoscalingPoliciesResponseAutoscalingPolicy

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, int?, CallSettings)

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

Lists autoscaling policies in the project.

Parameters
Name Description
parent RegionName

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}

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAutoscalingPoliciesResponseAutoscalingPolicy

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, int?, CallSettings)

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

Lists autoscaling policies in the project.

Parameters
Name Description
parent string

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}

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAutoscalingPoliciesResponseAutoscalingPolicy

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
Type Description
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
Name Description
policy AutoscalingPolicy

Required. The updated autoscaling policy.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request UpdateAutoscalingPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
policy AutoscalingPolicy

Required. The updated autoscaling policy.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
policy AutoscalingPolicy

Required. The updated autoscaling policy.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
request UpdateAutoscalingPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAutoscalingPolicy

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
Name Description
request UpdateAutoscalingPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAutoscalingPolicy

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);