forked from docs/doc-exports
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com> Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Lai, Weijian <laiweijian4@huawei.com> Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
90 lines
8.3 KiB
HTML
90 lines
8.3 KiB
HTML
<a name="modelarts_04_0191"></a><a name="modelarts_04_0191"></a>
|
|
|
|
<h1 class="topictitle1">Querying the List of Resource Flavors</h1>
|
|
<div id="body8662426"><div class="section" id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_section5592153085519"><h4 class="sectiontitle">Sample Code</h4><p id="modelarts_04_0191__en-us_topic_0180094060_p32101552154618">In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see <a href="modelarts_04_0123.html">Session Authentication</a>.</p>
|
|
<div class="codecoloring" codetype="Python" id="modelarts_04_0191__en-us_topic_0180094060_screen114163201019"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><span class="kn">from</span> <span class="nn">modelarts.session</span> <span class="kn">import</span> <span class="n">Session</span>
|
|
<span class="kn">from</span> <span class="nn">modelarts.estimator</span> <span class="kn">import</span> <span class="n">Estimator</span>
|
|
<span class="n">session</span> <span class="o">=</span> <span class="n">Session</span><span class="p">()</span>
|
|
<span class="n">algo_info</span> <span class="o">=</span> <span class="n">Estimator</span><span class="o">.</span><span class="n">get_train_instance_types</span><span class="p">(</span><span class="n">modelarts_session</span><span class="o">=</span><span class="n">session</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_section14139153717410"><h4 class="sectiontitle">Parameter Description</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_table155461191218" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_row254817912212"><th align="left" class="cellrowborder" valign="top" width="25.630000000000003%" id="mcps1.3.2.2.2.5.1.1"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p12549899214">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.410000000000002%" id="mcps1.3.2.2.2.5.1.2"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p3552101193813">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="11.310000000000002%" id="mcps1.3.2.2.2.5.1.3"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p1755169172118">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50.650000000000006%" id="mcps1.3.2.2.2.5.1.4"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p55521998211">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_row8893215413"><td class="cellrowborder" valign="top" width="25.630000000000003%" headers="mcps1.3.2.2.2.5.1.1 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p6891421842">modelarts_session</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.410000000000002%" headers="mcps1.3.2.2.2.5.1.2 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p68972047">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="11.310000000000002%" headers="mcps1.3.2.2.2.5.1.3 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p158912219419">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.650000000000006%" headers="mcps1.3.2.2.2.5.1.4 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p1689152543">Session object. For details about the initialization method, see <a href="modelarts_04_0123.html">Session Authentication</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_table973120224596" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Successful response parameters</caption><thead align="left"><tr id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_row2731522195910"><th align="left" class="cellrowborder" valign="top" width="25.2%" id="mcps1.3.3.2.3.1.1"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p117308225593">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="74.8%" id="mcps1.3.3.2.3.1.2"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p2730132255915">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_row1873172215912"><td class="cellrowborder" valign="top" width="25.2%" headers="mcps1.3.3.2.3.1.1 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p117311922115916">List</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="74.8%" headers="mcps1.3.3.2.3.1.2 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p6731182225914">List of resource flavor attributes</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_table55928961173927" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Failed response parameters</caption><thead align="left"><tr id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_row40618446173927"><th align="left" class="cellrowborder" valign="top" width="25.490000000000002%" id="mcps1.3.4.2.4.1.1"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p1631242217407">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="23.72%" id="mcps1.3.4.2.4.1.2"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p5427574117407">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50.79%" id="mcps1.3.4.2.4.1.3"><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p12364118914">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_row11062410173927"><td class="cellrowborder" valign="top" width="25.490000000000002%" headers="mcps1.3.4.2.4.1.1 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p688954611624">error_code</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.72%" headers="mcps1.3.4.2.4.1.2 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p3804851211624">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.79%" headers="mcps1.3.4.2.4.1.3 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p156551524172412">Error code when the API call fails.</p>
|
|
<p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p6203060911624">This parameter is not included when the API call succeeds.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_row52351653173927"><td class="cellrowborder" valign="top" width="25.490000000000002%" headers="mcps1.3.4.2.4.1.1 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p4368550411624">error_msg</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="23.72%" headers="mcps1.3.4.2.4.1.2 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p6574380911624">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.79%" headers="mcps1.3.4.2.4.1.3 "><p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p1277593619">Error message when the API call fails.</p>
|
|
<p id="modelarts_04_0191__en-us_topic_0180094060_en-us_topic_0160574646_p2364831411624">This parameter is not included when the API call succeeds.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="modelarts_04_0189.html">Resource and Engine Specifications</a></div>
|
|
</div>
|
|
</div>
|
|
|