All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization Maven / Gradle / Ivy

/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/compute/v1/compute.proto

// Protobuf Java Version: 3.25.5
package com.google.cloud.compute.v1;

/**
 *
 *
 * 
 * Custom utilization metric policy.
 * 
* * Protobuf type {@code google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization} */ public final class AutoscalingPolicyCustomMetricUtilization extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization) AutoscalingPolicyCustomMetricUtilizationOrBuilder { private static final long serialVersionUID = 0L; // Use AutoscalingPolicyCustomMetricUtilization.newBuilder() to construct. private AutoscalingPolicyCustomMetricUtilization( com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private AutoscalingPolicyCustomMetricUtilization() { filter_ = ""; metric_ = ""; utilizationTargetType_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new AutoscalingPolicyCustomMetricUtilization(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.compute.v1.Compute .internal_static_google_cloud_compute_v1_AutoscalingPolicyCustomMetricUtilization_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.compute.v1.Compute .internal_static_google_cloud_compute_v1_AutoscalingPolicyCustomMetricUtilization_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.class, com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder.class); } /** * * *
   * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
   * 
* * Protobuf enum {@code * google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType} */ public enum UtilizationTargetType implements com.google.protobuf.ProtocolMessageEnum { /** * * *
     * A value indicating that the enum field is not set.
     * 
* * UNDEFINED_UTILIZATION_TARGET_TYPE = 0; */ UNDEFINED_UTILIZATION_TARGET_TYPE(0), /** * * *
     * Sets the utilization target value for a cumulative or delta metric, expressed as the rate of growth per minute.
     * 
* * DELTA_PER_MINUTE = 87432861; */ DELTA_PER_MINUTE(87432861), /** * * *
     * Sets the utilization target value for a cumulative or delta metric, expressed as the rate of growth per second.
     * 
* * DELTA_PER_SECOND = 255180029; */ DELTA_PER_SECOND(255180029), /** * * *
     * Sets the utilization target value for a gauge metric. The autoscaler will collect the average utilization of the virtual machines from the last couple of minutes, and compare the value to the utilization target value to perform autoscaling.
     * 
* * GAUGE = 67590361; */ GAUGE(67590361), UNRECOGNIZED(-1), ; /** * * *
     * A value indicating that the enum field is not set.
     * 
* * UNDEFINED_UTILIZATION_TARGET_TYPE = 0; */ public static final int UNDEFINED_UTILIZATION_TARGET_TYPE_VALUE = 0; /** * * *
     * Sets the utilization target value for a cumulative or delta metric, expressed as the rate of growth per minute.
     * 
* * DELTA_PER_MINUTE = 87432861; */ public static final int DELTA_PER_MINUTE_VALUE = 87432861; /** * * *
     * Sets the utilization target value for a cumulative or delta metric, expressed as the rate of growth per second.
     * 
* * DELTA_PER_SECOND = 255180029; */ public static final int DELTA_PER_SECOND_VALUE = 255180029; /** * * *
     * Sets the utilization target value for a gauge metric. The autoscaler will collect the average utilization of the virtual machines from the last couple of minutes, and compare the value to the utilization target value to perform autoscaling.
     * 
* * GAUGE = 67590361; */ public static final int GAUGE_VALUE = 67590361; public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( "Can't get the number of an unknown enum value."); } return value; } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static UtilizationTargetType valueOf(int value) { return forNumber(value); } /** * @param value The numeric wire value of the corresponding enum entry. * @return The enum associated with the given numeric wire value. */ public static UtilizationTargetType forNumber(int value) { switch (value) { case 0: return UNDEFINED_UTILIZATION_TARGET_TYPE; case 87432861: return DELTA_PER_MINUTE; case 255180029: return DELTA_PER_SECOND; case 67590361: return GAUGE; default: return null; } } public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { public UtilizationTargetType findValueByNumber(int number) { return UtilizationTargetType.forNumber(number); } }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalStateException( "Can't get the descriptor of an unrecognized enum value."); } return getDescriptor().getValues().get(ordinal()); } public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { return getDescriptor(); } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.getDescriptor() .getEnumTypes() .get(0); } private static final UtilizationTargetType[] VALUES = values(); public static UtilizationTargetType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); } if (desc.getIndex() == -1) { return UNRECOGNIZED; } return VALUES[desc.getIndex()]; } private final int value; private UtilizationTargetType(int value) { this.value = value; } // @@protoc_insertion_point(enum_scope:google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType) } private int bitField0_; public static final int FILTER_FIELD_NUMBER = 336120696; @SuppressWarnings("serial") private volatile java.lang.Object filter_ = ""; /** * * *
   * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
   * 
* * optional string filter = 336120696; * * @return Whether the filter field is set. */ @java.lang.Override public boolean hasFilter() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
   * 
* * optional string filter = 336120696; * * @return The filter. */ @java.lang.Override public java.lang.String getFilter() { java.lang.Object ref = filter_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); filter_ = s; return s; } } /** * * *
   * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
   * 
* * optional string filter = 336120696; * * @return The bytes for filter. */ @java.lang.Override public com.google.protobuf.ByteString getFilterBytes() { java.lang.Object ref = filter_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); filter_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int METRIC_FIELD_NUMBER = 533067184; @SuppressWarnings("serial") private volatile java.lang.Object metric_ = ""; /** * * *
   * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
   * 
* * optional string metric = 533067184; * * @return Whether the metric field is set. */ @java.lang.Override public boolean hasMetric() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
   * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
   * 
* * optional string metric = 533067184; * * @return The metric. */ @java.lang.Override public java.lang.String getMetric() { java.lang.Object ref = metric_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); metric_ = s; return s; } } /** * * *
   * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
   * 
* * optional string metric = 533067184; * * @return The bytes for metric. */ @java.lang.Override public com.google.protobuf.ByteString getMetricBytes() { java.lang.Object ref = metric_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); metric_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SINGLE_INSTANCE_ASSIGNMENT_FIELD_NUMBER = 504768064; private double singleInstanceAssignment_ = 0D; /** * * *
   * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
   * 
* * optional double single_instance_assignment = 504768064; * * @return Whether the singleInstanceAssignment field is set. */ @java.lang.Override public boolean hasSingleInstanceAssignment() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
   * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
   * 
* * optional double single_instance_assignment = 504768064; * * @return The singleInstanceAssignment. */ @java.lang.Override public double getSingleInstanceAssignment() { return singleInstanceAssignment_; } public static final int UTILIZATION_TARGET_FIELD_NUMBER = 215905870; private double utilizationTarget_ = 0D; /** * * *
   * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances.
   * 
* * optional double utilization_target = 215905870; * * @return Whether the utilizationTarget field is set. */ @java.lang.Override public boolean hasUtilizationTarget() { return ((bitField0_ & 0x00000008) != 0); } /** * * *
   * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances.
   * 
* * optional double utilization_target = 215905870; * * @return The utilizationTarget. */ @java.lang.Override public double getUtilizationTarget() { return utilizationTarget_; } public static final int UTILIZATION_TARGET_TYPE_FIELD_NUMBER = 340169355; @SuppressWarnings("serial") private volatile java.lang.Object utilizationTargetType_ = ""; /** * * *
   * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
   * Check the UtilizationTargetType enum for the list of possible values.
   * 
* * optional string utilization_target_type = 340169355; * * @return Whether the utilizationTargetType field is set. */ @java.lang.Override public boolean hasUtilizationTargetType() { return ((bitField0_ & 0x00000010) != 0); } /** * * *
   * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
   * Check the UtilizationTargetType enum for the list of possible values.
   * 
* * optional string utilization_target_type = 340169355; * * @return The utilizationTargetType. */ @java.lang.Override public java.lang.String getUtilizationTargetType() { java.lang.Object ref = utilizationTargetType_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); utilizationTargetType_ = s; return s; } } /** * * *
   * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
   * Check the UtilizationTargetType enum for the list of possible values.
   * 
* * optional string utilization_target_type = 340169355; * * @return The bytes for utilizationTargetType. */ @java.lang.Override public com.google.protobuf.ByteString getUtilizationTargetTypeBytes() { java.lang.Object ref = utilizationTargetType_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); utilizationTargetType_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000008) != 0)) { output.writeDouble(215905870, utilizationTarget_); } if (((bitField0_ & 0x00000001) != 0)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 336120696, filter_); } if (((bitField0_ & 0x00000010) != 0)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 340169355, utilizationTargetType_); } if (((bitField0_ & 0x00000004) != 0)) { output.writeDouble(504768064, singleInstanceAssignment_); } if (((bitField0_ & 0x00000002) != 0)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 533067184, metric_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(215905870, utilizationTarget_); } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(336120696, filter_); } if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize( 340169355, utilizationTargetType_); } if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize( 504768064, singleInstanceAssignment_); } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(533067184, metric_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization)) { return super.equals(obj); } com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization other = (com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization) obj; if (hasFilter() != other.hasFilter()) return false; if (hasFilter()) { if (!getFilter().equals(other.getFilter())) return false; } if (hasMetric() != other.hasMetric()) return false; if (hasMetric()) { if (!getMetric().equals(other.getMetric())) return false; } if (hasSingleInstanceAssignment() != other.hasSingleInstanceAssignment()) return false; if (hasSingleInstanceAssignment()) { if (java.lang.Double.doubleToLongBits(getSingleInstanceAssignment()) != java.lang.Double.doubleToLongBits(other.getSingleInstanceAssignment())) return false; } if (hasUtilizationTarget() != other.hasUtilizationTarget()) return false; if (hasUtilizationTarget()) { if (java.lang.Double.doubleToLongBits(getUtilizationTarget()) != java.lang.Double.doubleToLongBits(other.getUtilizationTarget())) return false; } if (hasUtilizationTargetType() != other.hasUtilizationTargetType()) return false; if (hasUtilizationTargetType()) { if (!getUtilizationTargetType().equals(other.getUtilizationTargetType())) return false; } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasFilter()) { hash = (37 * hash) + FILTER_FIELD_NUMBER; hash = (53 * hash) + getFilter().hashCode(); } if (hasMetric()) { hash = (37 * hash) + METRIC_FIELD_NUMBER; hash = (53 * hash) + getMetric().hashCode(); } if (hasSingleInstanceAssignment()) { hash = (37 * hash) + SINGLE_INSTANCE_ASSIGNMENT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getSingleInstanceAssignment())); } if (hasUtilizationTarget()) { hash = (37 * hash) + UTILIZATION_TARGET_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getUtilizationTarget())); } if (hasUtilizationTargetType()) { hash = (37 * hash) + UTILIZATION_TARGET_TYPE_FIELD_NUMBER; hash = (53 * hash) + getUtilizationTargetType().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder( com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * *
   * Custom utilization metric policy.
   * 
* * Protobuf type {@code google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization) com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilizationOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.compute.v1.Compute .internal_static_google_cloud_compute_v1_AutoscalingPolicyCustomMetricUtilization_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.compute.v1.Compute .internal_static_google_cloud_compute_v1_AutoscalingPolicyCustomMetricUtilization_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.class, com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.Builder.class); } // Construct using // com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; filter_ = ""; metric_ = ""; singleInstanceAssignment_ = 0D; utilizationTarget_ = 0D; utilizationTargetType_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.compute.v1.Compute .internal_static_google_cloud_compute_v1_AutoscalingPolicyCustomMetricUtilization_descriptor; } @java.lang.Override public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization getDefaultInstanceForType() { return com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization .getDefaultInstance(); } @java.lang.Override public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization build() { com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization buildPartial() { com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization result = new com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0( com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) != 0)) { result.filter_ = filter_; to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000002) != 0)) { result.metric_ = metric_; to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000004) != 0)) { result.singleInstanceAssignment_ = singleInstanceAssignment_; to_bitField0_ |= 0x00000004; } if (((from_bitField0_ & 0x00000008) != 0)) { result.utilizationTarget_ = utilizationTarget_; to_bitField0_ |= 0x00000008; } if (((from_bitField0_ & 0x00000010) != 0)) { result.utilizationTargetType_ = utilizationTargetType_; to_bitField0_ |= 0x00000010; } result.bitField0_ |= to_bitField0_; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization) { return mergeFrom( (com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization other) { if (other == com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization .getDefaultInstance()) return this; if (other.hasFilter()) { filter_ = other.filter_; bitField0_ |= 0x00000001; onChanged(); } if (other.hasMetric()) { metric_ = other.metric_; bitField0_ |= 0x00000002; onChanged(); } if (other.hasSingleInstanceAssignment()) { setSingleInstanceAssignment(other.getSingleInstanceAssignment()); } if (other.hasUtilizationTarget()) { setUtilizationTarget(other.getUtilizationTarget()); } if (other.hasUtilizationTargetType()) { utilizationTargetType_ = other.utilizationTargetType_; bitField0_ |= 0x00000010; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 1727246961: { utilizationTarget_ = input.readDouble(); bitField0_ |= 0x00000008; break; } // case 1727246961 case -1606001726: { filter_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case -1606001726 case -1573612454: { utilizationTargetType_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000010; break; } // case -1573612454 case -256822783: { singleInstanceAssignment_ = input.readDouble(); bitField0_ |= 0x00000004; break; } // case -256822783 case -30429822: { metric_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case -30429822 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object filter_ = ""; /** * * *
     * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
     * 
* * optional string filter = 336120696; * * @return Whether the filter field is set. */ public boolean hasFilter() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
     * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
     * 
* * optional string filter = 336120696; * * @return The filter. */ public java.lang.String getFilter() { java.lang.Object ref = filter_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); filter_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
     * 
* * optional string filter = 336120696; * * @return The bytes for filter. */ public com.google.protobuf.ByteString getFilterBytes() { java.lang.Object ref = filter_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); filter_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
     * 
* * optional string filter = 336120696; * * @param value The filter to set. * @return This builder for chaining. */ public Builder setFilter(java.lang.String value) { if (value == null) { throw new NullPointerException(); } filter_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
     * 
* * optional string filter = 336120696; * * @return This builder for chaining. */ public Builder clearFilter() { filter_ = getDefaultInstance().getFilter(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
     * 
* * optional string filter = 336120696; * * @param value The bytes for filter to set. * @return This builder for chaining. */ public Builder setFilterBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); filter_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object metric_ = ""; /** * * *
     * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
     * 
* * optional string metric = 533067184; * * @return Whether the metric field is set. */ public boolean hasMetric() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
     * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
     * 
* * optional string metric = 533067184; * * @return The metric. */ public java.lang.String getMetric() { java.lang.Object ref = metric_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); metric_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
     * 
* * optional string metric = 533067184; * * @return The bytes for metric. */ public com.google.protobuf.ByteString getMetricBytes() { java.lang.Object ref = metric_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); metric_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
     * 
* * optional string metric = 533067184; * * @param value The metric to set. * @return This builder for chaining. */ public Builder setMetric(java.lang.String value) { if (value == null) { throw new NullPointerException(); } metric_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
     * 
* * optional string metric = 533067184; * * @return This builder for chaining. */ public Builder clearMetric() { metric_ = getDefaultInstance().getMetric(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * * *
     * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE.
     * 
* * optional string metric = 533067184; * * @param value The bytes for metric to set. * @return This builder for chaining. */ public Builder setMetricBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); metric_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private double singleInstanceAssignment_; /** * * *
     * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
     * 
* * optional double single_instance_assignment = 504768064; * * @return Whether the singleInstanceAssignment field is set. */ @java.lang.Override public boolean hasSingleInstanceAssignment() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
     * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
     * 
* * optional double single_instance_assignment = 504768064; * * @return The singleInstanceAssignment. */ @java.lang.Override public double getSingleInstanceAssignment() { return singleInstanceAssignment_; } /** * * *
     * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
     * 
* * optional double single_instance_assignment = 504768064; * * @param value The singleInstanceAssignment to set. * @return This builder for chaining. */ public Builder setSingleInstanceAssignment(double value) { singleInstanceAssignment_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
     * 
* * optional double single_instance_assignment = 504768064; * * @return This builder for chaining. */ public Builder clearSingleInstanceAssignment() { bitField0_ = (bitField0_ & ~0x00000004); singleInstanceAssignment_ = 0D; onChanged(); return this; } private double utilizationTarget_; /** * * *
     * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances.
     * 
* * optional double utilization_target = 215905870; * * @return Whether the utilizationTarget field is set. */ @java.lang.Override public boolean hasUtilizationTarget() { return ((bitField0_ & 0x00000008) != 0); } /** * * *
     * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances.
     * 
* * optional double utilization_target = 215905870; * * @return The utilizationTarget. */ @java.lang.Override public double getUtilizationTarget() { return utilizationTarget_; } /** * * *
     * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances.
     * 
* * optional double utilization_target = 215905870; * * @param value The utilizationTarget to set. * @return This builder for chaining. */ public Builder setUtilizationTarget(double value) { utilizationTarget_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances.
     * 
* * optional double utilization_target = 215905870; * * @return This builder for chaining. */ public Builder clearUtilizationTarget() { bitField0_ = (bitField0_ & ~0x00000008); utilizationTarget_ = 0D; onChanged(); return this; } private java.lang.Object utilizationTargetType_ = ""; /** * * *
     * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
     * Check the UtilizationTargetType enum for the list of possible values.
     * 
* * optional string utilization_target_type = 340169355; * * @return Whether the utilizationTargetType field is set. */ public boolean hasUtilizationTargetType() { return ((bitField0_ & 0x00000010) != 0); } /** * * *
     * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
     * Check the UtilizationTargetType enum for the list of possible values.
     * 
* * optional string utilization_target_type = 340169355; * * @return The utilizationTargetType. */ public java.lang.String getUtilizationTargetType() { java.lang.Object ref = utilizationTargetType_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); utilizationTargetType_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
     * Check the UtilizationTargetType enum for the list of possible values.
     * 
* * optional string utilization_target_type = 340169355; * * @return The bytes for utilizationTargetType. */ public com.google.protobuf.ByteString getUtilizationTargetTypeBytes() { java.lang.Object ref = utilizationTargetType_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); utilizationTargetType_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
     * Check the UtilizationTargetType enum for the list of possible values.
     * 
* * optional string utilization_target_type = 340169355; * * @param value The utilizationTargetType to set. * @return This builder for chaining. */ public Builder setUtilizationTargetType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } utilizationTargetType_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
     * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
     * Check the UtilizationTargetType enum for the list of possible values.
     * 
* * optional string utilization_target_type = 340169355; * * @return This builder for chaining. */ public Builder clearUtilizationTargetType() { utilizationTargetType_ = getDefaultInstance().getUtilizationTargetType(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** * * *
     * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
     * Check the UtilizationTargetType enum for the list of possible values.
     * 
* * optional string utilization_target_type = 340169355; * * @param value The bytes for utilizationTargetType to set. * @return This builder for chaining. */ public Builder setUtilizationTargetTypeBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); utilizationTargetType_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization) } // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization) private static final com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization(); } public static com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public AutoscalingPolicyCustomMetricUtilization parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy