class_docstr: SageMaker ``MultiDataModel`` can be used to deploy multiple models to the same ``Endpoint``.
  
  And also deploy additional models to an existing SageMaker multi-model ``Endpoint``
class_docstr_tok: ["SageMaker","``","MultiDataModel","``","can","be","used","to","deploy","multiple","models","to","the","same","``","Endpoint","``",".","And","also","deploy","additional","models","to","an","existing","SageMaker","multi-model","``","Endpoint","``"]
docstr: Initialize a ``MultiDataModel``.
  
  Addition to these arguments, it supports all arguments supported by ``Model`` constructor.
  
  Args:
      name (str): The model name.
      model_data_prefix (str): The S3 prefix where all the models artifacts (.tar.gz)
          in a Multi-Model endpoint are located
      model (sagemaker.Model): The Model object that would define the
          SageMaker model attributes like vpc_config, predictors, etc.
          If this is present, the attributes from this model are used when
          deploying the ``MultiDataModel``.  Parameters 'image_uri', 'role' and 'kwargs'
          are not permitted when model parameter is set.
      image_uri (str or PipelineVariable): A Docker image URI. It can be null if the 'model'
          parameter is passed to during ``MultiDataModel`` initialization (default: None)
      role (str): An AWS IAM role (either name or full ARN). The Amazon
          SageMaker training jobs and APIs that create Amazon SageMaker
          endpoints use this role to access training data and model
          artifacts. After the endpoint is created, the inference code
          might use the IAM role if it needs to access some AWS resources.
          It can be null if this is being used to create a Model to pass
          to a ``PipelineModel`` which has its own Role field or if the 'model' parameter
          is passed to during ``MultiDataModel`` initialization (default: None)
      sagemaker_session (sagemaker.session.Session): A SageMaker Session
          object, used for SageMaker interactions (default: None). If not
          specified, one is created using the default AWS configuration
          chain.
      **kwargs: Keyword arguments passed to the
          :class:`~sagemaker.model.Model` initializer.
  
  .. tip::
  
      You can find additional parameters for initializing this class at
      :class:`~sagemaker.model.Model`.
docstr_tok: ["Initialize","a","``","MultiDataModel","``",".","Addition","to","these","arguments",",","it","supports","all","arguments","supported","by","``","Model","``","constructor",".","Args",":","name","(","str",")",":","The","model","name",".","model_data_prefix","(","str",")",":","The","S3","prefix","where","all","the","models","artifacts","(",".tar.gz",")","in","a","Multi-Model","endpoint","are","located","model","(","sagemaker.Model",")",":","The","Model","object","that","would","define","the","SageMaker","model","attributes","like","vpc_config",",","predictors",",","etc",".","If","this","is","present",",","the","attributes","from","this","model","are","used","when","deploying","the","``","MultiDataModel","``",".","Parameters","'image_uri","'",",","'role","'","and","'kwargs'","are","not","permitted","when","model","parameter","is","set",".","image_uri","(","str","or","PipelineVariable",")",":","A","Docker","image","URI",".","It","can","be","null","if","the","'model'","parameter","is","passed","to","during","``","MultiDataModel","``","initialization","(","default",":","None",")","role","(","str",")",":","An","AWS","IAM","role","(","either","name","or","full","ARN",")",".","The","Amazon","SageMaker","training","jobs","and","APIs","that","create","Amazon","SageMaker","endpoints","use","this","role","to","access","training","data","and","model","artifacts",".","After","the","endpoint","is","created",",","the","inference","code","might","use","the","IAM","role","if","it","needs","to","access","some","AWS","resources",".","It","can","be","null","if","this","is","being","used","to","create","a","Model","to","pass","to","a","``","PipelineModel","``","which","has","its","own","Role","field","or","if","the","'model","'","parameter","is","passed","to","during","``","MultiDataModel","``","initialization","(","default",":","None",")","sagemaker_session","(","sagemaker.session.Session",")",":","A","SageMaker","Session","object",",","used","for","SageMaker","interactions","(","default",":","None",")",".","If","not","specified",",","one","is","created","using","the","default","AWS","configuration","chain",".","*","*","kwargs",":","Keyword","arguments","passed","to","the",":","class",":","`","~sagemaker.model.Model","`","initializer",".","..","tip",":",":","You","can","find","additional","parameters","for","initializing","this","class","at",":","class",":","`","~sagemaker.model.Model","`","."]
code: def __init__(
      self,
      name: str,
      model_data_prefix: str,
      model: Optional[Model] = None,
      image_uri: Optional[Union[str, PipelineVariable]] = None,
      role: Optional[str] = None,
      sagemaker_session: Optional[Session] = None,
      **kwargs,
  ):
      """Initialize a ``MultiDataModel``.
  
      Addition to these arguments, it supports all arguments supported by ``Model`` constructor.
  
      Args:
          name (str): The model name.
          model_data_prefix (str): The S3 prefix where all the models artifacts (.tar.gz)
              in a Multi-Model endpoint are located
          model (sagemaker.Model): The Model object that would define the
              SageMaker model attributes like vpc_config, predictors, etc.
              If this is present, the attributes from this model are used when
              deploying the ``MultiDataModel``.  Parameters 'image_uri', 'role' and 'kwargs'
              are not permitted when model parameter is set.
          image_uri (str or PipelineVariable): A Docker image URI. It can be null if the 'model'
              parameter is passed to during ``MultiDataModel`` initialization (default: None)
          role (str): An AWS IAM role (either name or full ARN). The Amazon
              SageMaker training jobs and APIs that create Amazon SageMaker
              endpoints use this role to access training data and model
              artifacts. After the endpoint is created, the inference code
              might use the IAM role if it needs to access some AWS resources.
              It can be null if this is being used to create a Model to pass
              to a ``PipelineModel`` which has its own Role field or if the 'model' parameter
              is passed to during ``MultiDataModel`` initialization (default: None)
          sagemaker_session (sagemaker.session.Session): A SageMaker Session
              object, used for SageMaker interactions (default: None). If not
              specified, one is created using the default AWS configuration
              chain.
          **kwargs: Keyword arguments passed to the
              :class:`~sagemaker.model.Model` initializer.
  
      .. tip::
  
          You can find additional parameters for initializing this class at
          :class:`~sagemaker.model.Model`.
      """
      # Validate path
      if not model_data_prefix.startswith("s3://"):
          raise ValueError(
              'Expecting S3 model prefix beginning with "s3://". Received: "{}"'.format(
                  model_data_prefix
              )
          )
  
      if model and (image_uri or role or kwargs):
          raise ValueError(
              "Parameters image_uri, role, and kwargs are not permitted when "
              "model parameter is passed."
          )
  
      self.name = name
      self.model_data_prefix = model_data_prefix
      self.model = model
      self.container_mode = MULTI_MODEL_CONTAINER_MODE
      self.sagemaker_session = sagemaker_session or Session()
      self.endpoint_name = None
  
      if self.sagemaker_session.s3_client is None:
          self.s3_client = self.sagemaker_session.boto_session.client(
              "s3",
              region_name=self.sagemaker_session.boto_session.region_name,
          )
      else:
          self.s3_client = self.sagemaker_session.s3_client
  
      # Set the ``Model`` parameters if the model parameter is not specified
      if not self.model:
          pop_out_unused_kwarg(
              "model_data", kwargs, self.model_data_prefix
          )
          super(MultiDataModel, self).__init__(
              image_uri,
              self.model_data_prefix,
              role,
              name=self.name,
              sagemaker_session=self.sagemaker_session,
              **kwargs,
          )
  
file_path: sagemaker-python-sdk/src/sagemaker/multidatamodel.py
imports: from __future__ import absolute_import
  import os
  from typing import Union, Optional
  from six.moves.urllib.parse import urlparse
  import sagemaker
  from sagemaker import local, s3
  from sagemaker.deprecations import removed_kwargs
  from sagemaker.model import Model
  from sagemaker.session import Session
  from sagemaker.utils import pop_out_unused_kwarg, format_tags
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 1 to create a new MultiDataModel object from inherited base classes: Model with example: obj = MultiDataModel(name, model_data_prefix, model, image_uri, role, sagemaker_session)