blob: c73cf79eb8c46bcbe5525a6cf62d33624e07f309 [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>airflow.contrib.hooks.sagemaker_hook &mdash; Airflow Documentation</title>
<script type="text/javascript" src="../../../../../_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="../../../../../" src="../../../../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../../../_static/language_data.js"></script>
<script type="text/javascript" src="../../../../../_static/js/theme.js"></script>
<link rel="stylesheet" href="../../../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../../search.html" />
<link rel="next" title="airflow.contrib.hooks.salesforce_hook" href="../salesforce_hook/index.html" />
<link rel="prev" title="airflow.contrib.hooks.redshift_hook" href="../redshift_hook/index.html" />
<script>
document.addEventListener('DOMContentLoaded', function() {
var el = document.getElementById('changelog');
if (el !== null ) {
// [AIRFLOW-...]
el.innerHTML = el.innerHTML.replace(
/\[(AIRFLOW-[\d]+)\]/g,
`<a href="https://issues.apache.org/jira/browse/$1">[$1]</a>`
);
// (#...)
el.innerHTML = el.innerHTML.replace(
/\(#([\d]+)\)/g,
`<a href="https://github.com/apache/airflow/pull/$1">(#$1)</a>`
);
};
})
</script>
<style>
.example-header {
position: relative;
background: #9AAA7A;
padding: 8px 16px;
margin-bottom: 0;
}
.example-header--with-button {
padding-right: 166px;
}
.example-header:after{
content: '';
display: table;
clear: both;
}
.example-title {
display:block;
padding: 4px;
margin-right: 16px;
color: white;
overflow-x: auto;
}
.example-header-button {
top: 8px;
right: 16px;
position: absolute;
}
.example-header + .highlight-python {
margin-top: 0 !important;
}
.viewcode-button {
display: inline-block;
padding: 8px 16px;
border: 0;
margin: 0;
outline: 0;
border-radius: 2px;
-webkit-box-shadow: 0 3px 5px 0 rgba(0,0,0,.3);
box-shadow: 0 3px 6px 0 rgba(0,0,0,.3);
color: #404040;
background-color: #e7e7e7;
cursor: pointer;
font-size: 16px;
font-weight: 500;
line-height: 1;
text-decoration: none;
text-overflow: ellipsis;
overflow: hidden;
text-transform: uppercase;
-webkit-transition: background-color .2s;
transition: background-color .2s;
vertical-align: middle;
white-space: nowrap;
}
.viewcode-button:visited {
color: #404040;
}
.viewcode-button:hover, .viewcode-button:focus {
color: #404040;
background-color: #d6d6d6;
}
</style>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../../../index.html" class="icon icon-home"> Airflow
</a>
<div class="version">
1.10.3
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../../../project.html">Project</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../start.html">Quick Start</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../howto/index.html">How-to Guides</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../ui.html">UI / Screenshots</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../concepts.html">Concepts</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../profiling.html">Data Profiling</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../cli.html">Command Line Interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../scheduler.html">Scheduling &amp; Triggers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../plugins.html">Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../security.html">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../timezone.html">Time zones</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../api.html">Experimental Rest API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../integration.html">Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../metrics.html">Metrics</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../kubernetes.html">Kubernetes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../lineage.html">Lineage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../changelog.html">Changelog</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../../macros.html">Macros reference</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../../index.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../../../index.html#operators">Operators</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../../../index.html#hooks">Hooks</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../../../../index.html#hooks-packages">Hooks packages</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="../../../hooks/index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.hooks</span></code></a></li>
<li class="toctree-l4 current"><a class="reference internal" href="../index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.contrib.hooks</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../../index.html#executors">Executors</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../../index.html#models">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../../index.html#core-and-community-package">Core and community package</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../../../index.html">Airflow</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../../../index.html">Docs</a> &raquo;</li>
<li><a href="../../../../index.html">API Reference</a> &raquo;</li>
<li><a href="../index.html"><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.contrib.hooks</span></code></a> &raquo;</li>
<li><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.contrib.hooks.sagemaker_hook</span></code></li>
<li class="wy-breadcrumbs-aside">
<a href="../../../../../_sources/_api/airflow/contrib/hooks/sagemaker_hook/index.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="module-airflow.contrib.hooks.sagemaker_hook">
<span id="airflow-contrib-hooks-sagemaker-hook"></span><h1><a class="reference internal" href="#module-airflow.contrib.hooks.sagemaker_hook" title="airflow.contrib.hooks.sagemaker_hook"><code class="xref py py-mod docutils literal notranslate"><span class="pre">airflow.contrib.hooks.sagemaker_hook</span></code></a><a class="headerlink" href="#module-airflow.contrib.hooks.sagemaker_hook" title="Permalink to this headline"></a></h1>
<div class="section" id="module-contents">
<h2>Module Contents<a class="headerlink" href="#module-contents" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="airflow.contrib.hooks.sagemaker_hook.LogState">
<em class="property">class </em><code class="descclassname">airflow.contrib.hooks.sagemaker_hook.</code><code class="descname">LogState</code><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#LogState"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.LogState" title="Permalink to this definition"></a></dt>
<dd><p>Bases:<a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="attribute">
<dt id="airflow.contrib.hooks.sagemaker_hook.LogState.STARTING">
<code class="descname">STARTING</code><em class="property"> = 1</em><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#LogState.STARTING"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.LogState.STARTING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.contrib.hooks.sagemaker_hook.LogState.WAIT_IN_PROGRESS">
<code class="descname">WAIT_IN_PROGRESS</code><em class="property"> = 2</em><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#LogState.WAIT_IN_PROGRESS"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.LogState.WAIT_IN_PROGRESS" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.contrib.hooks.sagemaker_hook.LogState.TAILING">
<code class="descname">TAILING</code><em class="property"> = 3</em><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#LogState.TAILING"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.LogState.TAILING" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.contrib.hooks.sagemaker_hook.LogState.JOB_COMPLETE">
<code class="descname">JOB_COMPLETE</code><em class="property"> = 4</em><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#LogState.JOB_COMPLETE"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.LogState.JOB_COMPLETE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.contrib.hooks.sagemaker_hook.LogState.COMPLETE">
<code class="descname">COMPLETE</code><em class="property"> = 5</em><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#LogState.COMPLETE"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.LogState.COMPLETE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="data">
<dt id="airflow.contrib.hooks.sagemaker_hook.Position">
<code class="descclassname">airflow.contrib.hooks.sagemaker_hook.</code><code class="descname">Position</code><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#Position"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.Position" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="airflow.contrib.hooks.sagemaker_hook.argmin">
<code class="descclassname">airflow.contrib.hooks.sagemaker_hook.</code><code class="descname">argmin</code><span class="sig-paren">(</span><em>arr</em>, <em>f</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#argmin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.argmin" title="Permalink to this definition"></a></dt>
<dd><p>Return the index, i, in arr that minimizes f(arr[i])</p>
</dd></dl>
<dl class="function">
<dt id="airflow.contrib.hooks.sagemaker_hook.secondary_training_status_changed">
<code class="descclassname">airflow.contrib.hooks.sagemaker_hook.</code><code class="descname">secondary_training_status_changed</code><span class="sig-paren">(</span><em>current_job_description</em>, <em>prev_job_description</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#secondary_training_status_changed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.secondary_training_status_changed" title="Permalink to this definition"></a></dt>
<dd><p>Returns true if training job’s secondary status message has changed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>current_job_description</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – Current job description, returned from DescribeTrainingJob call.</p></li>
<li><p><strong>prev_job_description</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – Previous job description, returned from DescribeTrainingJob call.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Whether the secondary status message of a training job changed or not.</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="airflow.contrib.hooks.sagemaker_hook.secondary_training_status_message">
<code class="descclassname">airflow.contrib.hooks.sagemaker_hook.</code><code class="descname">secondary_training_status_message</code><span class="sig-paren">(</span><em>job_description</em>, <em>prev_description</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#secondary_training_status_message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.secondary_training_status_message" title="Permalink to this definition"></a></dt>
<dd><p>Returns a string contains start time and the secondary training job status message.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>job_description</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – Returned response from DescribeTrainingJob call</p></li>
<li><p><strong>prev_description</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – Previous job description from DescribeTrainingJob call</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Job status string to be printed.</p>
</dd>
</dl>
</dd></dl>
<dl class="class">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook">
<em class="property">class </em><code class="descclassname">airflow.contrib.hooks.sagemaker_hook.</code><code class="descname">SageMakerHook</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook" title="Permalink to this definition"></a></dt>
<dd><p>Bases:<a class="reference internal" href="../aws_hook/index.html#airflow.contrib.hooks.aws_hook.AwsHook" title="airflow.contrib.hooks.aws_hook.AwsHook"><code class="xref py py-class docutils literal notranslate"><span class="pre">airflow.contrib.hooks.aws_hook.AwsHook</span></code></a></p>
<p>Interact with Amazon SageMaker.</p>
<dl class="attribute">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.non_terminal_states">
<code class="descname">non_terminal_states</code><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.non_terminal_states"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.non_terminal_states" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.endpoint_non_terminal_states">
<code class="descname">endpoint_non_terminal_states</code><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.endpoint_non_terminal_states"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.endpoint_non_terminal_states" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.failed_states">
<code class="descname">failed_states</code><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.failed_states"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.failed_states" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.tar_and_s3_upload">
<code class="descname">tar_and_s3_upload</code><span class="sig-paren">(</span><em>self</em>, <em>path</em>, <em>key</em>, <em>bucket</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.tar_and_s3_upload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.tar_and_s3_upload" title="Permalink to this definition"></a></dt>
<dd><p>Tar the local file or directory and upload to s3</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – local file or directory</p></li>
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – s3 key</p></li>
<li><p><strong>bucket</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – s3 bucket</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.configure_s3_resources">
<code class="descname">configure_s3_resources</code><span class="sig-paren">(</span><em>self</em>, <em>config</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.configure_s3_resources"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.configure_s3_resources" title="Permalink to this definition"></a></dt>
<dd><p>Extract the S3 operations from the configuration and execute them.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – config of SageMaker operation</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_s3_url">
<code class="descname">check_s3_url</code><span class="sig-paren">(</span><em>self</em>, <em>s3url</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.check_s3_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_s3_url" title="Permalink to this definition"></a></dt>
<dd><p>Check if an S3 URL exists</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>s3url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – S3 url</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)">bool</a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_training_config">
<code class="descname">check_training_config</code><span class="sig-paren">(</span><em>self</em>, <em>training_config</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.check_training_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_training_config" title="Permalink to this definition"></a></dt>
<dd><p>Check if a training configuration is valid</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>training_config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – training_config</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_tuning_config">
<code class="descname">check_tuning_config</code><span class="sig-paren">(</span><em>self</em>, <em>tuning_config</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.check_tuning_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_tuning_config" title="Permalink to this definition"></a></dt>
<dd><p>Check if a tuning configuration is valid</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>tuning_config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – tuning_config</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.get_conn">
<code class="descname">get_conn</code><span class="sig-paren">(</span><em>self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.get_conn"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.get_conn" title="Permalink to this definition"></a></dt>
<dd><p>Establish an AWS connection for SageMaker</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client" title="(in Boto 3 Docs v1.9.130)"><code class="xref py py-class docutils literal notranslate"><span class="pre">SageMaker.Client</span></code></a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.get_log_conn">
<code class="descname">get_log_conn</code><span class="sig-paren">(</span><em>self</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.get_log_conn"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.get_log_conn" title="Permalink to this definition"></a></dt>
<dd><p>Establish an AWS connection for retrieving logs during training</p>
<dl class="field-list simple">
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client" title="(in Boto 3 Docs v1.9.130)">CloudWatchLogs.Client</a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.log_stream">
<code class="descname">log_stream</code><span class="sig-paren">(</span><em>self</em>, <em>log_group</em>, <em>stream_name</em>, <em>start_time=0</em>, <em>skip=0</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.log_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.log_stream" title="Permalink to this definition"></a></dt>
<dd><p>A generator for log items in a single stream. This will yield all the
items that are available at the current moment.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>log_group</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The name of the log group.</p></li>
<li><p><strong>stream_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The name of the specific stream.</p></li>
<li><p><strong>start_time</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – The time stamp value to start reading the logs from (default: 0).</p></li>
<li><p><strong>skip</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – The number of log entries to skip at the start (default: 0).
This is for when there are multiple entries at the same timestamp.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)">dict</a></p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><div class="line-block">
<div class="line">A CloudWatch log event with the following key-value pairs:</div>
<div class="line-block">
<div class="line">’timestamp’ (int): The time in milliseconds of the event.</div>
<div class="line">’message’ (str): The log event data.</div>
<div class="line">’ingestionTime’ (int): The time in milliseconds the event was ingested.</div>
</div>
</div>
</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.multi_stream_iter">
<code class="descname">multi_stream_iter</code><span class="sig-paren">(</span><em>self</em>, <em>log_group</em>, <em>streams</em>, <em>positions=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.multi_stream_iter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.multi_stream_iter" title="Permalink to this definition"></a></dt>
<dd><p>Iterate over the available events coming from a set of log streams in a single log group
interleaving the events from each stream so they’re yielded in timestamp order.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>log_group</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – The name of the log group.</p></li>
<li><p><strong>streams</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) – A list of the log stream names. The position of the stream in this list is
the stream number.</p></li>
<li><p><strong>positions</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.7)"><em>list</em></a>) – A list of pairs of (timestamp, skip) which represents the last record
read from each stream.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A tuple of (stream number, cloudwatch log event).</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_training_job">
<code class="descname">create_training_job</code><span class="sig-paren">(</span><em>self</em>, <em>config</em>, <em>wait_for_completion=True</em>, <em>print_log=True</em>, <em>check_interval=30</em>, <em>max_ingestion_time=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.create_training_job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_training_job" title="Permalink to this definition"></a></dt>
<dd><p>Create a training job</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – the config for training</p></li>
<li><p><strong>wait_for_completion</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – if the program should keep running until job finishes</p></li>
<li><p><strong>check_interval</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the time interval in seconds which the operator
will check the status of any SageMaker job</p></li>
<li><p><strong>max_ingestion_time</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the maximum ingestion time in seconds. Any
SageMaker jobs that run longer than this will fail. Setting this to
None implies no timeout for any SageMaker job.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A response to training job creation</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_tuning_job">
<code class="descname">create_tuning_job</code><span class="sig-paren">(</span><em>self</em>, <em>config</em>, <em>wait_for_completion=True</em>, <em>check_interval=30</em>, <em>max_ingestion_time=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.create_tuning_job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_tuning_job" title="Permalink to this definition"></a></dt>
<dd><p>Create a tuning job</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – the config for tuning</p></li>
<li><p><strong>wait_for_completion</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – if the program should keep running until job finishes</p></li>
<li><p><strong>check_interval</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the time interval in seconds which the operator
will check the status of any SageMaker job</p></li>
<li><p><strong>max_ingestion_time</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the maximum ingestion time in seconds. Any
SageMaker jobs that run longer than this will fail. Setting this to
None implies no timeout for any SageMaker job.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A response to tuning job creation</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_transform_job">
<code class="descname">create_transform_job</code><span class="sig-paren">(</span><em>self</em>, <em>config</em>, <em>wait_for_completion=True</em>, <em>check_interval=30</em>, <em>max_ingestion_time=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.create_transform_job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_transform_job" title="Permalink to this definition"></a></dt>
<dd><p>Create a transform job</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – the config for transform job</p></li>
<li><p><strong>wait_for_completion</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – if the program should keep running until job finishes</p></li>
<li><p><strong>check_interval</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the time interval in seconds which the operator
will check the status of any SageMaker job</p></li>
<li><p><strong>max_ingestion_time</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the maximum ingestion time in seconds. Any
SageMaker jobs that run longer than this will fail. Setting this to
None implies no timeout for any SageMaker job.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A response to transform job creation</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_model">
<code class="descname">create_model</code><span class="sig-paren">(</span><em>self</em>, <em>config</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.create_model"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_model" title="Permalink to this definition"></a></dt>
<dd><p>Create a model job</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – the config for model</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A response to model creation</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_endpoint_config">
<code class="descname">create_endpoint_config</code><span class="sig-paren">(</span><em>self</em>, <em>config</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.create_endpoint_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_endpoint_config" title="Permalink to this definition"></a></dt>
<dd><p>Create an endpoint config</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – the config for endpoint-config</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A response to endpoint config creation</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_endpoint">
<code class="descname">create_endpoint</code><span class="sig-paren">(</span><em>self</em>, <em>config</em>, <em>wait_for_completion=True</em>, <em>check_interval=30</em>, <em>max_ingestion_time=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.create_endpoint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.create_endpoint" title="Permalink to this definition"></a></dt>
<dd><p>Create an endpoint</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – the config for endpoint</p></li>
<li><p><strong>wait_for_completion</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – if the program should keep running until job finishes</p></li>
<li><p><strong>check_interval</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the time interval in seconds which the operator
will check the status of any SageMaker job</p></li>
<li><p><strong>max_ingestion_time</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the maximum ingestion time in seconds. Any
SageMaker jobs that run longer than this will fail. Setting this to
None implies no timeout for any SageMaker job.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A response to endpoint creation</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.update_endpoint">
<code class="descname">update_endpoint</code><span class="sig-paren">(</span><em>self</em>, <em>config</em>, <em>wait_for_completion=True</em>, <em>check_interval=30</em>, <em>max_ingestion_time=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.update_endpoint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.update_endpoint" title="Permalink to this definition"></a></dt>
<dd><p>Update an endpoint</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>config</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.7)"><em>dict</em></a>) – the config for endpoint</p></li>
<li><p><strong>wait_for_completion</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – if the program should keep running until job finishes</p></li>
<li><p><strong>check_interval</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the time interval in seconds which the operator
will check the status of any SageMaker job</p></li>
<li><p><strong>max_ingestion_time</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the maximum ingestion time in seconds. Any
SageMaker jobs that run longer than this will fail. Setting this to
None implies no timeout for any SageMaker job.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A response to endpoint update</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_training_job">
<code class="descname">describe_training_job</code><span class="sig-paren">(</span><em>self</em>, <em>name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.describe_training_job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_training_job" title="Permalink to this definition"></a></dt>
<dd><p>Return the training job info associated with the name</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – the name of the training job</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict contains all the training job info</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_training_job_with_log">
<code class="descname">describe_training_job_with_log</code><span class="sig-paren">(</span><em>self</em>, <em>job_name</em>, <em>positions</em>, <em>stream_names</em>, <em>instance_count</em>, <em>state</em>, <em>last_description</em>, <em>last_describe_job_call</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.describe_training_job_with_log"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_training_job_with_log" title="Permalink to this definition"></a></dt>
<dd><p>Return the training job info associated with job_name and print CloudWatch logs</p>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_tuning_job">
<code class="descname">describe_tuning_job</code><span class="sig-paren">(</span><em>self</em>, <em>name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.describe_tuning_job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_tuning_job" title="Permalink to this definition"></a></dt>
<dd><p>Return the tuning job info associated with the name</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> (<em>string</em>) – the name of the tuning job</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict contains all the tuning job info</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_model">
<code class="descname">describe_model</code><span class="sig-paren">(</span><em>self</em>, <em>name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.describe_model"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_model" title="Permalink to this definition"></a></dt>
<dd><p>Return the SageMaker model info associated with the name</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> (<em>string</em>) – the name of the SageMaker model</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict contains all the model info</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_transform_job">
<code class="descname">describe_transform_job</code><span class="sig-paren">(</span><em>self</em>, <em>name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.describe_transform_job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_transform_job" title="Permalink to this definition"></a></dt>
<dd><p>Return the transform job info associated with the name</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> (<em>string</em>) – the name of the transform job</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict contains all the transform job info</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_endpoint_config">
<code class="descname">describe_endpoint_config</code><span class="sig-paren">(</span><em>self</em>, <em>name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.describe_endpoint_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_endpoint_config" title="Permalink to this definition"></a></dt>
<dd><p>Return the endpoint config info associated with the name</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> (<em>string</em>) – the name of the endpoint config</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict contains all the endpoint config info</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_endpoint">
<code class="descname">describe_endpoint</code><span class="sig-paren">(</span><em>self</em>, <em>name</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.describe_endpoint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.describe_endpoint" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> (<em>string</em>) – the name of the endpoint</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict contains all the endpoint info</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_status">
<code class="descname">check_status</code><span class="sig-paren">(</span><em>self</em>, <em>job_name</em>, <em>key</em>, <em>describe_function</em>, <em>check_interval</em>, <em>max_ingestion_time</em>, <em>non_terminal_states=None</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.check_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_status" title="Permalink to this definition"></a></dt>
<dd><p>Check status of a SageMaker job</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>job_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – name of the job to check status</p></li>
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – the key of the response dict
that points to the state</p></li>
<li><p><strong>describe_function</strong> (<em>python callable</em>) – the function used to retrieve the status</p></li>
<li><p><strong>args</strong> – the arguments for the function</p></li>
<li><p><strong>check_interval</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the time interval in seconds which the operator
will check the status of any SageMaker job</p></li>
<li><p><strong>max_ingestion_time</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the maximum ingestion time in seconds. Any
SageMaker jobs that run longer than this will fail. Setting this to
None implies no timeout for any SageMaker job.</p></li>
<li><p><strong>non_terminal_states</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#set" title="(in Python v3.7)"><em>set</em></a>) – the set of nonterminal states</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>response of describe call after job is done</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_training_status_with_log">
<code class="descname">check_training_status_with_log</code><span class="sig-paren">(</span><em>self</em>, <em>job_name</em>, <em>non_terminal_states</em>, <em>failed_states</em>, <em>wait_for_completion</em>, <em>check_interval</em>, <em>max_ingestion_time</em><span class="sig-paren">)</span><a class="reference internal" href="../../../../../_modules/airflow/contrib/hooks/sagemaker_hook.html#SageMakerHook.check_training_status_with_log"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#airflow.contrib.hooks.sagemaker_hook.SageMakerHook.check_training_status_with_log" title="Permalink to this definition"></a></dt>
<dd><p>Display the logs for a given training job, optionally tailing them until the
job is complete.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>job_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.7)"><em>str</em></a>) – name of the training job to check status and display logs for</p></li>
<li><p><strong>non_terminal_states</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#set" title="(in Python v3.7)"><em>set</em></a>) – the set of non_terminal states</p></li>
<li><p><strong>failed_states</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#set" title="(in Python v3.7)"><em>set</em></a>) – the set of failed states</p></li>
<li><p><strong>wait_for_completion</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.7)"><em>bool</em></a>) – Whether to keep looking for new log entries
until the job completes</p></li>
<li><p><strong>check_interval</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – The interval in seconds between polling for new log entries and job completion</p></li>
<li><p><strong>max_ingestion_time</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.7)"><em>int</em></a>) – the maximum ingestion time in seconds. Any
SageMaker jobs that run longer than this will fail. Setting this to
None implies no timeout for any SageMaker job.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../salesforce_hook/index.html" class="btn btn-neutral float-right" title="airflow.contrib.hooks.salesforce_hook" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="../redshift_hook/index.html" class="btn btn-neutral float-left" title="airflow.contrib.hooks.redshift_hook" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>