class_docstr: Make prediction requests to an Amazon SageMaker endpoint.
class_docstr_tok: ["Make","prediction","requests","to","an","Amazon","SageMaker","endpoint","."]
docstr: Update the existing endpoint with the provided attributes.
  
  This creates a new EndpointConfig in the process. If ``initial_instance_count``,
  ``instance_type``, ``accelerator_type``, or ``model_name`` is specified, then a new
  ProductionVariant configuration is created; values from the existing configuration
  are not preserved if any of those parameters are specified.
  
  Args:
      initial_instance_count (int): The initial number of instances to run in the endpoint.
          This is required if ``instance_type``, ``accelerator_type``, or ``model_name`` is
          specified. Otherwise, the values from the existing endpoint configuration's
          ProductionVariants are used.
      instance_type (str): The EC2 instance type to deploy the endpoint to.
          This is required if ``initial_instance_count`` or ``accelerator_type`` is specified.
          Otherwise, the values from the existing endpoint configuration's
          ``ProductionVariants`` are used.
      accelerator_type (str): The type of Elastic Inference accelerator to attach to
          the endpoint, e.g. "ml.eia1.medium". If not specified, and
          ``initial_instance_count``, ``instance_type``, and ``model_name`` are also ``None``,
          the values from the existing endpoint configuration's ``ProductionVariants`` are
          used. Otherwise, no Elastic Inference accelerator is attached to the endpoint.
      model_name (str): The name of the model to be associated with the endpoint.
          This is required if ``initial_instance_count``, ``instance_type``, or
          ``accelerator_type`` is specified and if there is more than one model associated
          with the endpoint. Otherwise, the existing model for the endpoint is used.
      tags (list[dict[str, str]]): The list of tags to add to the endpoint
          config. If not specified, the tags of the existing endpoint configuration are used.
          If any of the existing tags are reserved AWS ones (i.e. begin with "aws"),
          they are not carried over to the new endpoint configuration.
      kms_key (str): The KMS key that is used to encrypt the data on the storage volume
          attached to the instance hosting the endpoint If not specified,
          the KMS key of the existing endpoint configuration is used.
      data_capture_config_dict (dict): The endpoint data capture configuration
          for use with Amazon SageMaker Model Monitoring. If not specified,
          the data capture configuration of the existing endpoint configuration is used.
      max_instance_count (int): The maximum instance count used for scaling instance.
      min_instance_count (int): The minimum instance count used for scaling instance.
  
  Raises:
      ValueError: If there is not enough information to create a new ``ProductionVariant``:
  
          - If ``initial_instance_count``, ``accelerator_type``, or ``model_name`` is
            specified, but ``instance_type`` is ``None``.
          - If ``initial_instance_count``, ``instance_type``, or ``accelerator_type`` is
            specified and either ``model_name`` is ``None`` or there are multiple models
            associated with the endpoint.
docstr_tok: ["Update","the","existing","endpoint","with","the","provided","attributes",".","This","creates","a","new","EndpointConfig","in","the","process",".","If","``","initial_instance_count","``",",","``","instance_type","``",",","``","accelerator_type","``",",","or","``","model_name","``","is","specified",",","then","a","new","ProductionVariant","configuration","is","created",";","values","from","the","existing","configuration","are","not","preserved","if","any","of","those","parameters","are","specified",".","Args",":","initial_instance_count","(","int",")",":","The","initial","number","of","instances","to","run","in","the","endpoint",".","This","is","required","if","``","instance_type","``",",","``","accelerator_type","``",",","or","``","model_name","``","is","specified",".","Otherwise",",","the","values","from","the","existing","endpoint","configuration's","ProductionVariants","are","used",".","instance_type","(","str",")",":","The","EC2","instance","type","to","deploy","the","endpoint","to",".","This","is","required","if","``","initial_instance_count","``","or","``","accelerator_type","``","is","specified",".","Otherwise",",","the","values","from","the","existing","endpoint","configuration's","``","ProductionVariants","``","are","used",".","accelerator_type","(","str",")",":","The","type","of","Elastic","Inference","accelerator","to","attach","to","the","endpoint",",","e.g",".","``","ml.eia1.medium","''",".","If","not","specified",",","and","``","initial_instance_count","``",",","``","instance_type","``",",","and","``","model_name","``","are","also","``","None","``",",","the","values","from","the","existing","endpoint","configuration","'s","``","ProductionVariants","``","are","used",".","Otherwise",",","no","Elastic","Inference","accelerator","is","attached","to","the","endpoint",".","model_name","(","str",")",":","The","name","of","the","model","to","be","associated","with","the","endpoint",".","This","is","required","if","``","initial_instance_count","``",",","``","instance_type","``",",","or","``","accelerator_type","``","is","specified","and","if","there","is","more","than","one","model","associated","with","the","endpoint",".","Otherwise",",","the","existing","model","for","the","endpoint","is","used",".","tags","(","list","[","dict","[","str",",","str","]","]",")",":","The","list","of","tags","to","add","to","the","endpoint","config",".","If","not","specified",",","the","tags","of","the","existing","endpoint","configuration","are","used",".","If","any","of","the","existing","tags","are","reserved","AWS","ones","(","i.e",".","begin","with","``","aws","''",")",",","they","are","not","carried","over","to","the","new","endpoint","configuration",".","kms_key","(","str",")",":","The","KMS","key","that","is","used","to","encrypt","the","data","on","the","storage","volume","attached","to","the","instance","hosting","the","endpoint","If","not","specified",",","the","KMS","key","of","the","existing","endpoint","configuration","is","used",".","data_capture_config_dict","(","dict",")",":","The","endpoint","data","capture","configuration","for","use","with","Amazon","SageMaker","Model","Monitoring",".","If","not","specified",",","the","data","capture","configuration","of","the","existing","endpoint","configuration","is","used",".","max_instance_count","(","int",")",":","The","maximum","instance","count","used","for","scaling","instance",".","min_instance_count","(","int",")",":","The","minimum","instance","count","used","for","scaling","instance",".","Raises",":","ValueError",":","If","there","is","not","enough","information","to","create","a","new","``","ProductionVariant","``",":","-","If","``","initial_instance_count","``",",","``","accelerator_type","``",",","or","``","model_name","``","is","specified",",","but","``","instance_type","``","is","``","None","``",".","-","If","``","initial_instance_count","``",",","``","instance_type","``",",","or","``","accelerator_type","``","is","specified","and","either","``","model_name","``","is","``","None","``","or","there","are","multiple","models","associated","with","the","endpoint","."]
code: def update_endpoint(
      self,
      initial_instance_count=None,
      instance_type=None,
      accelerator_type=None,
      model_name=None,
      tags=None,
      kms_key=None,
      data_capture_config_dict=None,
      max_instance_count=None,
      min_instance_count=None,
      wait=True,
  ):
      """Update the existing endpoint with the provided attributes.
  
      This creates a new EndpointConfig in the process. If ``initial_instance_count``,
      ``instance_type``, ``accelerator_type``, or ``model_name`` is specified, then a new
      ProductionVariant configuration is created; values from the existing configuration
      are not preserved if any of those parameters are specified.
  
      Args:
          initial_instance_count (int): The initial number of instances to run in the endpoint.
              This is required if ``instance_type``, ``accelerator_type``, or ``model_name`` is
              specified. Otherwise, the values from the existing endpoint configuration's
              ProductionVariants are used.
          instance_type (str): The EC2 instance type to deploy the endpoint to.
              This is required if ``initial_instance_count`` or ``accelerator_type`` is specified.
              Otherwise, the values from the existing endpoint configuration's
              ``ProductionVariants`` are used.
          accelerator_type (str): The type of Elastic Inference accelerator to attach to
              the endpoint, e.g. "ml.eia1.medium". If not specified, and
              ``initial_instance_count``, ``instance_type``, and ``model_name`` are also ``None``,
              the values from the existing endpoint configuration's ``ProductionVariants`` are
              used. Otherwise, no Elastic Inference accelerator is attached to the endpoint.
          model_name (str): The name of the model to be associated with the endpoint.
              This is required if ``initial_instance_count``, ``instance_type``, or
              ``accelerator_type`` is specified and if there is more than one model associated
              with the endpoint. Otherwise, the existing model for the endpoint is used.
          tags (list[dict[str, str]]): The list of tags to add to the endpoint
              config. If not specified, the tags of the existing endpoint configuration are used.
              If any of the existing tags are reserved AWS ones (i.e. begin with "aws"),
              they are not carried over to the new endpoint configuration.
          kms_key (str): The KMS key that is used to encrypt the data on the storage volume
              attached to the instance hosting the endpoint If not specified,
              the KMS key of the existing endpoint configuration is used.
          data_capture_config_dict (dict): The endpoint data capture configuration
              for use with Amazon SageMaker Model Monitoring. If not specified,
              the data capture configuration of the existing endpoint configuration is used.
          max_instance_count (int): The maximum instance count used for scaling instance.
          min_instance_count (int): The minimum instance count used for scaling instance.
  
      Raises:
          ValueError: If there is not enough information to create a new ``ProductionVariant``:
  
              - If ``initial_instance_count``, ``accelerator_type``, or ``model_name`` is
                specified, but ``instance_type`` is ``None``.
              - If ``initial_instance_count``, ``instance_type``, or ``accelerator_type`` is
                specified and either ``model_name`` is ``None`` or there are multiple models
                associated with the endpoint.
      """
      production_variants = None
      current_model_names = self._get_model_names()
  
      if (
          initial_instance_count
          or instance_type
          or accelerator_type
          or model_name
      ):
          if instance_type is None or initial_instance_count is None:
              raise ValueError(
                  "Missing initial_instance_count and/or instance_type. Provided values: "
                  "initial_instance_count={}, instance_type={}, accelerator_type={}, "
                  "model_name={}.".format(
                      initial_instance_count,
                      instance_type,
                      accelerator_type,
                      model_name,
                  )
              )
  
          if model_name is None:
              if len(current_model_names) > 1:
                  raise ValueError(
                      "Unable to choose a default model for a new EndpointConfig because "
                      "the endpoint has multiple models: {}".format(
                          ", ".join(current_model_names)
                      )
                  )
              model_name = current_model_names[0]
          else:
              self._model_names = [model_name]
  
          managed_instance_scaling: Dict[str, int] = {}
          if max_instance_count:
              managed_instance_scaling[
                  "MaxInstanceCount"
              ] = max_instance_count
          if min_instance_count:
              managed_instance_scaling[
                  "MinInstanceCount"
              ] = min_instance_count
  
          if (
              managed_instance_scaling
              and len(managed_instance_scaling) > 0
          ):
              production_variant_config = production_variant(
                  model_name,
                  instance_type,
                  initial_instance_count=initial_instance_count,
                  accelerator_type=accelerator_type,
                  managed_instance_scaling=managed_instance_scaling,
              )
          else:
              production_variant_config = production_variant(
                  model_name,
                  instance_type,
                  initial_instance_count=initial_instance_count,
                  accelerator_type=accelerator_type,
              )
          production_variants = [production_variant_config]
  
      current_endpoint_config_name = self._get_endpoint_config_name()
      new_endpoint_config_name = name_from_base(
          current_endpoint_config_name
      )
  
      if self._get_component_name():
          endpoint_type = EndpointType.INFERENCE_COMPONENT_BASED
      else:
          endpoint_type = EndpointType.MODEL_BASED
  
      self.sagemaker_session.create_endpoint_config_from_existing(
          current_endpoint_config_name,
          new_endpoint_config_name,
          new_tags=format_tags(tags),
          new_kms_key=kms_key,
          new_data_capture_config_dict=data_capture_config_dict,
          new_production_variants=production_variants,
          endpoint_type=endpoint_type,
      )
      self.sagemaker_session.update_endpoint(
          self.endpoint_name, new_endpoint_config_name, wait=wait
      )
      self._endpoint_config_name = new_endpoint_config_name
  
imports: from __future__ import print_function, absolute_import
  import abc
  import datetime
  from typing import Any, Dict, Optional, Tuple, Union
  import logging
  from sagemaker.enums import EndpointType
  from sagemaker.deprecations import deprecated_class, deprecated_deserialize, deprecated_serialize, removed_kwargs, renamed_kwargs, renamed_warning
  from sagemaker.deserializers import BytesDeserializer, CSVDeserializer, JSONDeserializer, NumpyDeserializer, StreamDeserializer, StringDeserializer
  from sagemaker.jumpstart.payload_utils import PayloadSerializer
  from sagemaker.jumpstart.types import JumpStartSerializablePayload
  from sagemaker.jumpstart.utils import get_jumpstart_content_bucket
  from sagemaker.model_monitor import DataCaptureConfig, DefaultModelMonitor, ModelBiasMonitor, ModelExplainabilityMonitor, ModelMonitor, ModelQualityMonitor
  from sagemaker.serializers import CSVSerializer, IdentitySerializer, JSONSerializer, NumpySerializer
  from sagemaker.session import production_variant, Session
  from sagemaker.utils import name_from_base, stringify_object, format_tags
  from sagemaker.model_monitor.model_monitoring import DEFAULT_REPOSITORY_NAME
  from sagemaker.lineage.context import EndpointContext
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
label_desc: Use image node_id 5 for calling the Predictor obj's underlying member method code with example usage: obj.update_endpoint(initial_instance_count, instance_type, accelerator_type, model_name, tags, kms_key, data_capture_config_dict, max_instance_count, min_instance_count, wait) without return types