Class Rollout.TrafficPercentStrategy

  • All Implemented Interfaces:
    Rollout.TrafficPercentStrategyOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable
    Enclosing class:
    Rollout

    public static final class Rollout.TrafficPercentStrategy
    extends com.google.protobuf.GeneratedMessageV3
    implements Rollout.TrafficPercentStrategyOrBuilder
     Strategy that specifies how clients of Google Service Controller want to
     send traffic to use different config versions. This is generally
     used by API proxy to split traffic based on your configured percentage for
     each config version.
    
     One example of how to gradually rollout a new service configuration using
     this
     strategy:
     Day 1
    
         Rollout {
           id: "example.googleapis.com/rollout_20160206"
           traffic_percent_strategy {
             percentages: {
               "example.googleapis.com/20160201": 70.00
               "example.googleapis.com/20160206": 30.00
             }
           }
         }
    
     Day 2
    
         Rollout {
           id: "example.googleapis.com/rollout_20160207"
           traffic_percent_strategy: {
             percentages: {
               "example.googleapis.com/20160206": 100.00
             }
           }
         }
     
    Protobuf type google.api.servicemanagement.v1.Rollout.TrafficPercentStrategy
    See Also:
    Serialized Form
    • Field Detail

      • PERCENTAGES_FIELD_NUMBER

        public static final int PERCENTAGES_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • containsPercentages

        public boolean containsPercentages​(String key)
         Maps service configuration IDs to their corresponding traffic percentage.
         Key is the service configuration ID, Value is the traffic percentage
         which must be greater than 0.0 and the sum must equal to 100.0.
         
        map<string, double> percentages = 1;
        Specified by:
        containsPercentages in interface Rollout.TrafficPercentStrategyOrBuilder
      • getPercentagesMap

        public Map<String,​Double> getPercentagesMap()
         Maps service configuration IDs to their corresponding traffic percentage.
         Key is the service configuration ID, Value is the traffic percentage
         which must be greater than 0.0 and the sum must equal to 100.0.
         
        map<string, double> percentages = 1;
        Specified by:
        getPercentagesMap in interface Rollout.TrafficPercentStrategyOrBuilder
      • getPercentagesOrDefault

        public double getPercentagesOrDefault​(String key,
                                              double defaultValue)
         Maps service configuration IDs to their corresponding traffic percentage.
         Key is the service configuration ID, Value is the traffic percentage
         which must be greater than 0.0 and the sum must equal to 100.0.
         
        map<string, double> percentages = 1;
        Specified by:
        getPercentagesOrDefault in interface Rollout.TrafficPercentStrategyOrBuilder
      • getPercentagesOrThrow

        public double getPercentagesOrThrow​(String key)
         Maps service configuration IDs to their corresponding traffic percentage.
         Key is the service configuration ID, Value is the traffic percentage
         which must be greater than 0.0 and the sum must equal to 100.0.
         
        map<string, double> percentages = 1;
        Specified by:
        getPercentagesOrThrow in interface Rollout.TrafficPercentStrategyOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Rollout.TrafficPercentStrategy parseFrom​(ByteBuffer data)
                                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rollout.TrafficPercentStrategy parseFrom​(ByteBuffer data,
                                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rollout.TrafficPercentStrategy parseFrom​(com.google.protobuf.ByteString data)
                                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rollout.TrafficPercentStrategy parseFrom​(com.google.protobuf.ByteString data,
                                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rollout.TrafficPercentStrategy parseFrom​(byte[] data)
                                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Rollout.TrafficPercentStrategy parseFrom​(byte[] data,
                                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                        throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • newBuilderForType

        public Rollout.TrafficPercentStrategy.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public Rollout.TrafficPercentStrategy.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected Rollout.TrafficPercentStrategy.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<Rollout.TrafficPercentStrategy> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Rollout.TrafficPercentStrategy getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder