Class Rollout.TrafficPercentStrategy.Builder

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

    public static final class Rollout.TrafficPercentStrategy.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Rollout.TrafficPercentStrategy.Builder>
    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
    • Method Detail

      • 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.Builder<Rollout.TrafficPercentStrategy.Builder>
      • internalGetMutableMapField

        protected com.google.protobuf.MapField internalGetMutableMapField​(int number)
        Overrides:
        internalGetMutableMapField in class com.google.protobuf.GeneratedMessageV3.Builder<Rollout.TrafficPercentStrategy.Builder>
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Rollout.TrafficPercentStrategy.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Rollout.TrafficPercentStrategy.Builder>
      • getDefaultInstanceForType

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

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

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

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Rollout.TrafficPercentStrategy.Builder>
      • 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
      • removePercentages

        public Rollout.TrafficPercentStrategy.Builder removePercentages​(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;
      • getMutablePercentages

        @Deprecated
        public Map<String,​Double> getMutablePercentages()
        Deprecated.
        Use alternate mutation accessors instead.
      • putPercentages

        public Rollout.TrafficPercentStrategy.Builder putPercentages​(String key,
                                                                     double value)
         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;
      • putAllPercentages

        public Rollout.TrafficPercentStrategy.Builder putAllPercentages​(Map<String,​Double> values)
         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;