doc-exports/docs/vpc/api-ref/vpc_flow_0001.html
Qin Ying, Fan 310d2d9eb1 VPC API 20230106 version
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com>
Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
2024-02-06 08:38:37 +00:00

327 lines
28 KiB
HTML

<a name="vpc_flow_0001"></a><a name="vpc_flow_0001"></a>
<h1 class="topictitle1">Creating a VPC Flow Log</h1>
<div id="body1548225405722"><div class="section" id="vpc_flow_0001__section1349945813399"><h4 class="sectiontitle">Function</h4><p id="vpc_flow_0001__p10937158143918">This API is used to create a VPC flow log.</p>
<p id="vpc_flow_0001__p3436113105613">A VPC flow log captures information about the traffic going to and from your VPC. You can use flow logs to monitor network traffic, analyze network attacks, and to determine whether security group and <span id="vpc_flow_0001__text651519411517"></span><span id="vpc_flow_0001__text123811244854">firewall</span> rules need to be modified.</p>
<p id="vpc_flow_0001__p38692616421">VPC flow logs must be used together with the Log Tank Service (LTS). You need to create a log group and a log topic in LTS, and then create a VPC flow log.</p>
</div>
<div class="section" id="vpc_flow_0001__section149915853914"><h4 class="sectiontitle">URI</h4><p id="vpc_flow_0001__p3937165803916">POST /v1/{project_id}/fl/flow_logs</p>
<p id="vpc_flow_0001__p17789155311512"><a href="#vpc_flow_0001__table1851575853914">Table 1</a> describes the parameters.</p>
<div class="tablenoborder"><a name="vpc_flow_0001__table1851575853914"></a><a name="table1851575853914"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_flow_0001__table1851575853914" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="vpc_flow_0001__row1993745814390"><th align="left" class="cellrowborder" valign="top" width="14.288571142885711%" id="mcps1.3.2.4.2.5.1.1"><p id="vpc_flow_0001__p15937165816394"><strong id="vpc_flow_0001__b148487544110">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.407959204079592%" id="mcps1.3.2.4.2.5.1.2"><p id="vpc_flow_0001__p4937658183913"><strong id="vpc_flow_0001__b84235270615219">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.407959204079592%" id="mcps1.3.2.4.2.5.1.3"><p id="vpc_flow_0001__p11937458183910"><strong id="vpc_flow_0001__b842352706145623">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.89551044895511%" id="mcps1.3.2.4.2.5.1.4"><p id="vpc_flow_0001__p493715883917"><strong id="vpc_flow_0001__b1638383415">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_flow_0001__row793795843915"><td class="cellrowborder" valign="top" width="14.288571142885711%" headers="mcps1.3.2.4.2.5.1.1 "><p id="vpc_flow_0001__p13937658153913">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.407959204079592%" headers="mcps1.3.2.4.2.5.1.2 "><p id="vpc_flow_0001__p16937158183920">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20.407959204079592%" headers="mcps1.3.2.4.2.5.1.3 "><p id="vpc_flow_0001__p893755819399">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.89551044895511%" headers="mcps1.3.2.4.2.5.1.4 "><p id="vpc_flow_0001__p10487112">Project ID. </p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_flow_0001__section153175823910"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_flow_0001__table853105814391" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameter</caption><thead align="left"><tr id="vpc_flow_0001__row89371858113911"><th align="left" class="cellrowborder" valign="top" width="13.370000000000001%" id="mcps1.3.3.2.2.5.1.1"><p id="vpc_flow_0001__p1893785863911"><strong id="vpc_flow_0001__b0379530164116">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.709999999999999%" id="mcps1.3.3.2.2.5.1.2"><p id="vpc_flow_0001__p19697114197"><strong id="vpc_flow_0001__b1394766340">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.6%" id="mcps1.3.3.2.2.5.1.3"><p id="vpc_flow_0001__p6937115819397"><strong id="vpc_flow_0001__b04561731204119">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.32%" id="mcps1.3.3.2.2.5.1.4"><p id="vpc_flow_0001__p193720580393"><strong id="vpc_flow_0001__b163631632194115">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_flow_0001__row893785811396"><td class="cellrowborder" valign="top" width="13.370000000000001%" headers="mcps1.3.3.2.2.5.1.1 "><p id="vpc_flow_0001__p893725818397">flow_log</p>
</td>
<td class="cellrowborder" valign="top" width="12.709999999999999%" headers="mcps1.3.3.2.2.5.1.2 "><p id="vpc_flow_0001__p6698645919">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21.6%" headers="mcps1.3.3.2.2.5.1.3 "><p id="vpc_flow_0001__p179370582392"><a href="#vpc_flow_0001__table656165873916">flow_log</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="52.32%" headers="mcps1.3.3.2.2.5.1.4 "><p id="vpc_flow_0001__p159372058193910"><strong id="vpc_flow_0001__b4840913185011">FlowLog</strong> objects. For details, see <a href="#vpc_flow_0001__table656165873916">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_flow_0001__table656165873916"></a><a name="table656165873916"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_flow_0001__table656165873916" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Description of the <strong id="vpc_flow_0001__b15871223124213">FlowLog</strong> field</caption><thead align="left"><tr id="vpc_flow_0001__row129371158123910"><th align="left" class="cellrowborder" valign="top" width="18.36816318368163%" id="mcps1.3.3.3.2.5.1.1"><p id="vpc_flow_0001__p17937758103914"><strong id="vpc_flow_0001__b9571724134214">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.3.3.2.5.1.2"><p id="vpc_flow_0001__p169371258113915"><strong id="vpc_flow_0001__b14210103884214">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.3.3.2.5.1.3"><p id="vpc_flow_0001__p3937558163918"><strong id="vpc_flow_0001__b12194739174213">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.93530646935306%" id="mcps1.3.3.3.2.5.1.4"><p id="vpc_flow_0001__p1693716581396"><strong id="vpc_flow_0001__b1795114012421">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_flow_0001__row1293785823916"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_flow_0001__p49371458203916">name</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_flow_0001__p293765812392">No</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_flow_0001__p17937185814394">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.93530646935306%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_flow_0001__ul025731633714"><li id="vpc_flow_0001__li1816912163714">Flow log name.</li><li id="vpc_flow_0001__li22526911389">The value can contain no more than 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row693745853920"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_flow_0001__p7937195814395">description</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_flow_0001__p149375582393">No</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_flow_0001__p3937958103917">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.93530646935306%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_flow_0001__ul74054431539"><li id="vpc_flow_0001__li653018461836">Flow log description</li><li id="vpc_flow_0001__li840516431733">The value can contain no more than 255 characters and cannot contain angle brackets (&lt; or &gt;).</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row593795883919"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_flow_0001__p1593710582399">resource_type</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_flow_0001__p1293715833911">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_flow_0001__p17937458123914">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.93530646935306%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_flow_0001__ul692882411811"><li id="vpc_flow_0001__li16467391187">Type of the resource for which that the logs to be collected.</li><li id="vpc_flow_0001__li210915115407">The value can be:<ul id="vpc_flow_0001__ul181714278405"><li id="vpc_flow_0001__li867861914403"><strong id="vpc_flow_0001__b157685267123">port</strong>: NIC</li><li id="vpc_flow_0001__li154619220409"><strong id="vpc_flow_0001__b649516411128">vpc</strong>: All NICs in a VPC</li><li id="vpc_flow_0001__li5929142418819"><strong id="vpc_flow_0001__b11996175719127">network</strong>: All NICs in a subnet</li></ul>
</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row2937145893912"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_flow_0001__p1937115863912">resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_flow_0001__p13937145815398">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_flow_0001__p2093735811398">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.93530646935306%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_flow_0001__ul153121279910"><li id="vpc_flow_0001__li103131871694">ID of the resource for which that the logs to be collected.</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row393717581395"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_flow_0001__p1093735814394">traffic_type</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_flow_0001__p9937135853911">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_flow_0001__p1693745883918">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.93530646935306%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_flow_0001__ul10871656142914"><li id="vpc_flow_0001__li4645134919166">Type of the traffic for which that the logs to be collected.</li><li id="vpc_flow_0001__li141031022112612">The value can be:<ul id="vpc_flow_0001__ul771424132614"><li id="vpc_flow_0001__li88761526171712"><strong id="vpc_flow_0001__b17875150141314">all</strong>: specifies that both accepted and rejected traffic of the specified resource will be logged.</li><li id="vpc_flow_0001__li1787195642914"><strong id="vpc_flow_0001__b6510107155413">accept</strong>: specifies that only accepted inbound and outbound traffic of the specified resource will be logged.</li><li id="vpc_flow_0001__li9871856112915"><strong id="vpc_flow_0001__b1644231585510">reject</strong>: specifies that only rejected inbound and outbound traffic of the specified resource will be logged.</li></ul>
</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row10937358203912"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_flow_0001__p159372581393">log_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_flow_0001__p593745863919">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_flow_0001__p1193795803911">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.93530646935306%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_flow_0001__ul1662081744114"><li id="vpc_flow_0001__li36201717154111">Log group ID</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row793717586396"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_flow_0001__p7937115812398">log_topic_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_flow_0001__p19371558173919">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_flow_0001__p15937258103911">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.93530646935306%" headers="mcps1.3.3.3.2.5.1.4 "><ul id="vpc_flow_0001__ul38501024194116"><li id="vpc_flow_0001__li158501424154117">Log topic ID</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row552333651313"><td class="cellrowborder" valign="top" width="18.36816318368163%" headers="mcps1.3.3.3.2.5.1.1 "><p id="vpc_flow_0001__p5117103911315">index_enabled</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.2 "><p id="vpc_flow_0001__p7117103912139">No</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="vpc_flow_0001__p16117639121314">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="46.93530646935306%" headers="mcps1.3.3.3.2.5.1.4 "><p id="vpc_flow_0001__p51171839191313">Whether to enable the log index.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_flow_0001__section2711174511910"><h4 class="sectiontitle">Example Request</h4><ul id="vpc_flow_0001__ul151012481911"><li id="vpc_flow_0001__li19101548297">Create a VPC flow log. Set the resource type to port, resource ID to 05c4052d-8d14-488f-aa00-19fea5a25fde, traffic type to reject, log group ID to 05c4052d-8d14-488f-aa00-19fea5a25fdd, and log topic ID to a9d7dee7-37d2-4cba-a208-a016252aaa63.<pre class="screen" id="vpc_flow_0001__screen893765817399">POST https://{Endpoint}/v1/b2782e6708b8475c993e6064bc456bf8/fl/flow_logs
{
"flow_log": {
"name": "flowlog",
"description": "just a test",
"resource_type": "port",
"resource_id": "05c4052d-8d14-488f-aa00-19fea5a25fde",
"traffic_type": "reject",
"log_group_id": "05c4052d-8d14-488f-aa00-19fea5a25fdd",
"log_topic_id": "a9d7dee7-37d2-4cba-a208-a016252aaa63",
"index_enabled": true
}
}</pre>
</li></ul>
<p id="vpc_flow_0001__p1293711585397"></p>
</div>
<div class="section" id="vpc_flow_0001__section16608358193917"><h4 class="sectiontitle">Response Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpc_flow_0001__table14625205817393" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response parameter</caption><thead align="left"><tr id="vpc_flow_0001__row11937145810398"><th align="left" class="cellrowborder" valign="top" width="18.18%" id="mcps1.3.5.2.2.4.1.1"><p id="vpc_flow_0001__p59374583391"><strong id="vpc_flow_0001__b482011482012">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.25%" id="mcps1.3.5.2.2.4.1.2"><p id="vpc_flow_0001__p3937155873918"><strong id="vpc_flow_0001__b10803155207">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.57%" id="mcps1.3.5.2.2.4.1.3"><p id="vpc_flow_0001__p693745883919"><strong id="vpc_flow_0001__b338506162015">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_flow_0001__row119371558143915"><td class="cellrowborder" valign="top" width="18.18%" headers="mcps1.3.5.2.2.4.1.1 "><p id="vpc_flow_0001__p99371758183910">flow_log</p>
</td>
<td class="cellrowborder" valign="top" width="25.25%" headers="mcps1.3.5.2.2.4.1.2 "><p id="vpc_flow_0001__p1193755843911"><a href="#vpc_flow_0001__table763920584395">flow_log</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="56.57%" headers="mcps1.3.5.2.2.4.1.3 "><p id="vpc_flow_0001__p119374580399"><strong id="vpc_flow_0001__b615112620232">FlowLog</strong> objects. For details, see <a href="#vpc_flow_0001__table763920584395">Table 5</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="vpc_flow_0001__table763920584395"></a><a name="table763920584395"></a><table cellpadding="4" cellspacing="0" summary="" id="vpc_flow_0001__table763920584395" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Description of the <strong id="vpc_flow_0001__b397119172019">FlowLog</strong> field</caption><thead align="left"><tr id="vpc_flow_0001__row1993725815391"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.3.2.4.1.1"><p id="vpc_flow_0001__p293714582397"><strong id="vpc_flow_0001__b1784731242012">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.5.3.2.4.1.2"><p id="vpc_flow_0001__p149371458113917"><strong id="vpc_flow_0001__b19890101314206">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="54%" id="mcps1.3.5.3.2.4.1.3"><p id="vpc_flow_0001__p159376583395"><strong id="vpc_flow_0001__b9651714122010">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpc_flow_0001__row29378583393"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p1937205819397">id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p5937105873915">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul2042752118339"><li id="vpc_flow_0001__li1642742112337">Flow log ID</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row1293725816394"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p20937145883911">name</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p10937105813391">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul1573649133311"><li id="vpc_flow_0001__li65731149133314">Flow log name</li><li id="vpc_flow_0001__li15573349113313">The value can contain no more than 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row6937758193914"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p1793711586397">tenant_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p15937135818397">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul095835923313"><li id="vpc_flow_0001__li1995812591333">Project ID</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row8937258173912"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p593705817390">description</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p093712588392">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul9605816153419"><li id="vpc_flow_0001__li146051916133410">Flow log description</li><li id="vpc_flow_0001__li1560519167342">The value can contain no more than 255 characters and cannot contain angle brackets (&lt; or &gt;).</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row7937205883910"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p1393795823920">resource_type</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p10937858133920">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul065112543412"><li id="vpc_flow_0001__li26511625133413">Type of the resource for which that the logs to be collected.</li><li id="vpc_flow_0001__li206511825153419">The value can be:<ul id="vpc_flow_0001__ul176511125113415"><li id="vpc_flow_0001__li186511225103416"><strong id="vpc_flow_0001__b101726475197">port</strong>: NIC</li><li id="vpc_flow_0001__li2651625143412"><strong id="vpc_flow_0001__b9431848141916">vpc</strong>: All NICs in a VPC</li><li id="vpc_flow_0001__li106511625173410"><strong id="vpc_flow_0001__b16481124917198">network</strong>: All NICs in a subnet</li></ul>
</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row189371758133919"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p693745853910">resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p1893725843915">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul1785754473419"><li id="vpc_flow_0001__li7857164415346">ID of the resource for which that the logs to be collected.</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row19371458163912"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p11937135813399">traffic_type</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p159371058143918">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul1366295614347"><li id="vpc_flow_0001__li2662175620343">Type of the traffic for which that the logs to be collected.</li><li id="vpc_flow_0001__li36621356143413">The value can be:<ul id="vpc_flow_0001__ul1766205616345"><li id="vpc_flow_0001__li16626563348"><strong id="vpc_flow_0001__b16145714209">all</strong>: specifies that both accepted and rejected traffic of the specified resource will be logged.</li><li id="vpc_flow_0001__li366215613342"><strong id="vpc_flow_0001__b13456737">accept</strong>: specifies that only accepted inbound and outbound traffic of the specified resource will be logged.</li><li id="vpc_flow_0001__li1666215653413"><strong id="vpc_flow_0001__b1677629063">reject</strong>: specifies that only rejected inbound and outbound traffic of the specified resource will be logged.</li></ul>
</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row1993795813391"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p11937258153912">log_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p1593716589399">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul187751810203512"><li id="vpc_flow_0001__li1577501010350">Log group ID</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row69371358193919"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p9937105811399">log_topic_id</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p3937195853911">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul1232516177351"><li id="vpc_flow_0001__li193251417103511">Log topic ID</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row136208348143"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p347964381414">index_enabled</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p847916434144">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul109644521427"><li id="vpc_flow_0001__li7964155210425">Whether to enable the log index function</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row149526285714"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p1948613611718">admin_state</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p11486936674">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul1051945714220"><li id="vpc_flow_0001__li19519157154213">Whether to enable the flow log function</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row102334258716"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p74861036479">status</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p1948613361478">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul12491821389"><li id="vpc_flow_0001__li20841825204218">Flow log status</li><li id="vpc_flow_0001__li109721541134211">The value can be:<ul id="vpc_flow_0001__ul697204113425"><li id="vpc_flow_0001__li199711441164218"><strong id="vpc_flow_0001__b1269312464265">ACTIVE</strong>: Enabled</li><li id="vpc_flow_0001__li209713415421"><strong id="vpc_flow_0001__b84235270619274">DOWN</strong>: Disabled</li><li id="vpc_flow_0001__li597216412420"><strong id="vpc_flow_0001__b842352706192830">ERROR</strong>: Abnormal</li></ul>
</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row593715813910"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p6937125803920">created_at</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p6937105823914">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul1227113165412"><li id="vpc_flow_0001__li10271531155411">Time when the flow log is created</li><li id="vpc_flow_0001__li490133325417">UTC time in the format of yyyy-MM-ddTHH:mmss</li></ul>
</td>
</tr>
<tr id="vpc_flow_0001__row0937358193913"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p id="vpc_flow_0001__p1793713589392">updated_at</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.5.3.2.4.1.2 "><p id="vpc_flow_0001__p15937458113912">String</p>
</td>
<td class="cellrowborder" valign="top" width="54%" headers="mcps1.3.5.3.2.4.1.3 "><ul id="vpc_flow_0001__ul16087498548"><li id="vpc_flow_0001__li5608184915547">Time when the flow log is updated</li><li id="vpc_flow_0001__li121143521542">UTC time in the format of yyyy-MM-ddTHH:mmss</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpc_flow_0001__section06425661020"><h4 class="sectiontitle">Example Response</h4><pre class="screen" id="vpc_flow_0001__screen7697593813">{
"flow_log": {
"id": "f49f00f1-0f15-470a-a8c5-4e879e461c8d",
"name": "flowlog",
"description": "just a test",
"tenant_id": "b2782e6708b8475c993e6064bc456bf8",
"resource_type": "port",
"resource_id": "05c4052d-8d14-488f-aa00-19fea5a25fde",
"traffic_type": "reject",
"log_group_id": "05c4052d-8d14-488f-aa00-19fea5a25fdd",
"log_topic_id": "a9d7dee7-37d2-4cba-a208-a016252aaa63",
"created_at": "2019-01-14T11:03:02",
"updated_at": "2019-01-14T11:03:02",
"index_enabled": false,
"admin_state": true,
"status": "ACTIVE"
}
}</pre>
</div>
<div class="section" id="vpc_flow_0001__section31981619"><h4 class="sectiontitle">Status Code</h4><p id="vpc_flow_0001__p18112112662914">See <a href="vpc_api_0002.html">Status Codes</a>.</p>
</div>
<div class="section" id="vpc_flow_0001__section85821649202813"><h4 class="sectiontitle">Error Code</h4><p id="vpc_flow_0001__p17281622133910">See <a href="vpc_api_0003.html">Error Codes</a>.</p>
</div>
<p id="vpc_flow_0001__p8060118"></p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="vpc_flow_0000.html">VPC Flow Log</a></div>
</div>
</div>