class_docstr: A SageMaker Runtime client that calls a local endpoint only.
class_docstr_tok: ["A","SageMaker","Runtime","client","that","calls","a","local","endpoint","only","."]
docstr: Invoke the endpoint.
  
  Args:
      Body: Input data for which you want the model to provide inference.
      EndpointName: The name of the endpoint that you specified when you
          created the endpoint using the CreateEndpoint API.
      ContentType: The MIME type of the input data in the request body (Default value = None)
      Accept: The desired MIME type of the inference in the response (Default value = None)
      CustomAttributes: Provides additional information about a request for an inference
          submitted to a model hosted at an Amazon SageMaker endpoint (Default value = None)
      TargetModel: The model to request for inference when invoking a multi-model endpoint
          (Default value = None)
      TargetVariant: Specify the production variant to send the inference request to when
          invoking an endpoint that is running two or more variants (Default value = None)
      InferenceId: If you provide a value, it is added to the captured data when you enable
         data capture on the endpoint (Default value = None)
  
  Returns:
      object: Inference for the given input.
code: def invoke_endpoint(
      self,
      Body,
      EndpointName,  # pylint: disable=unused-argument
      ContentType=None,
      Accept=None,
      CustomAttributes=None,
      TargetModel=None,
      TargetVariant=None,
      InferenceId=None,
  ):
      """Invoke the endpoint.
  
      Args:
          Body: Input data for which you want the model to provide inference.
          EndpointName: The name of the endpoint that you specified when you
              created the endpoint using the CreateEndpoint API.
          ContentType: The MIME type of the input data in the request body (Default value = None)
          Accept: The desired MIME type of the inference in the response (Default value = None)
          CustomAttributes: Provides additional information about a request for an inference
              submitted to a model hosted at an Amazon SageMaker endpoint (Default value = None)
          TargetModel: The model to request for inference when invoking a multi-model endpoint
              (Default value = None)
          TargetVariant: Specify the production variant to send the inference request to when
              invoking an endpoint that is running two or more variants (Default value = None)
          InferenceId: If you provide a value, it is added to the captured data when you enable
             data capture on the endpoint (Default value = None)
  
      Returns:
          object: Inference for the given input.
      """
      url = "http://%s:%d/invocations" % (
          get_docker_host(),
          self.serving_port,
      )
      headers = {}
  
      if ContentType is not None:
          headers["Content-type"] = ContentType
  
      if Accept is not None:
          headers["Accept"] = Accept
  
      if CustomAttributes is not None:
          headers[
              "X-Amzn-SageMaker-Custom-Attributes"
          ] = CustomAttributes
  
      if TargetModel is not None:
          headers["X-Amzn-SageMaker-Target-Model"] = TargetModel
  
      if TargetVariant is not None:
          headers["X-Amzn-SageMaker-Target-Variant"] = TargetVariant
  
      if InferenceId is not None:
          headers["X-Amzn-SageMaker-Inference-Id"] = InferenceId
  
      # The http client encodes all strings using latin-1, which is not what we want.
      if isinstance(Body, str):
          Body = Body.encode("utf-8")
      r = self.http.request(
          "POST", url, body=Body, preload_content=False, headers=headers
      )
  
      return {"Body": r, "ContentType": Accept}
  
imports: from __future__ import absolute_import, annotations
  import logging
  import platform
  from datetime import datetime
  from typing import Dict
  import boto3
  from botocore.exceptions import ClientError
  import jsonschema
  from sagemaker.config import SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA, SESSION_DEFAULT_S3_BUCKET_PATH, SESSION_DEFAULT_S3_OBJECT_KEY_PREFIX_PATH, load_local_mode_config, load_sagemaker_config, validate_sagemaker_config
  from sagemaker.local.image import _SageMakerContainer
  from sagemaker.local.utils import get_docker_host
  from sagemaker.local.entities import _LocalEndpointConfig, _LocalEndpoint, _LocalModel, _LocalProcessingJob, _LocalTrainingJob, _LocalTransformJob, _LocalPipeline
  from sagemaker.session import Session
  from sagemaker.utils import get_config_value, _module_import_error, resolve_value_from_config, format_tags
label_desc: Use image node_id 4 for calling the LocalSagemakerRuntimeClient obj's underlying member method code with example usage: obj.invoke_endpoint(Body, EndpointName, ContentType, Accept, CustomAttributes, TargetModel, TargetVariant, InferenceId) and returns: dict