All Products
Search
Document Center

Virtual Private Cloud:CreateFlowLog

Last Updated:Jun 19, 2026

Membuat log aliran.

Deskripsi operasi

CreateFlowLog adalah operasi asinkron. Setelah Anda memanggil operasi ini, sistem akan mengembalikan ID Instans, tetapi log aliran belum dibuat. node pembuatan masih Berjalan di latar belakang. Anda dapat memanggil DescribeFlowLogs untuk mengkueri status pembuatan log aliran:

  • Jika log aliran berada dalam status Activating, log aliran sedang dibuat.

  • Jika log aliran berada dalam status Active, log aliran telah dibuat dan diaktifkan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

vpc:CreateFlowLog

create

VSwitch

acs:vpc:{#regionid}:{#accountId}:vswitch/{#VSwitchId}

*FlowLog

acs:vpc:{#regionId}:{#accountId}:flowlog/*

VPC

acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID Wilayah log aliran. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru.

cn-qingdao

FlowLogName

string

No

Nama log aliran.

Panjang nama harus 1 hingga 128 karakter dan tidak boleh diawali dengan http:// atau https://.

myFlowlog

Description

string

No

Deskripsi log aliran.

Panjang deskripsi harus 1 hingga 256 karakter dan tidak boleh diawali dengan http:// atau https://.

This is my Flowlog.

ResourceType

string

Yes

Tipe Sumber daya tempat menangkap Trafik. Nilai valid:

  • NetworkInterface: pengontrol antarmuka jaringan (NIC).

  • VSwitch: semua pengontrol antarmuka jaringan (NIC) di vSwitch.

  • VPC: semua pengontrol antarmuka jaringan (NIC) di virtual private cloud (VPC).

NetworkInterface

ResourceId

string

Yes

ID Sumber daya tempat menangkap Trafik.

eni-askldfas****

TrafficType

string

Yes

Tipe trafik yang akan dikumpulkan. Nilai valid:

  • All: semua trafik.

  • Allow: trafik yang diizinkan oleh kontrol akses.

  • Drop: trafik yang ditolak oleh kontrol akses.

All

ProjectName

string

No

Nama proyek yang mengelola trafik yang ditangkap.

  • Nama proyek hanya dapat berisi huruf kecil, digit, dan tanda hubung (-).

  • Nama harus diawali dan diakhiri dengan huruf kecil atau digit.

  • Panjang nama harus 3 hingga 63 karakter.

FlowLogProject

LogStoreName

string

No

Nama penyimpanan log yang menyimpan Trafik yang ditangkap.

  • Nama penyimpanan log hanya dapat berisi huruf kecil, digit, tanda hubung (-), dan garis bawah (_).

  • Nama harus diawali dan diakhiri dengan huruf kecil atau digit.

  • Panjang nama harus 3 hingga 63 karakter.

FlowLogStore

AggregationInterval

integer

No

Interval Pengambilan sampel log aliran. Unit: menit. Nilai valid: 1, 5, dan 10 (default).

10

TrafficPath

array

No

Jalur trafik yang akan ditangkap. Nilai valid:

  • all: menangkap semua trafik.

  • internetGateway: menangkap lalu lintas internet.

string

No

Jalur Trafik yang akan ditangkap. Nilai valid:

  • all (default): menangkap semua Trafik.

Catatan

Fitur jalur trafik tidak diaktifkan secara default. Untuk menggunakan fitur ini, ajukan Tiket.

.

all

ResourceGroupId

string

No

ID kelompok sumber daya.

rg-acfmxazdjdhd****

Tag

array<object>

No

Tag Sumber daya.

object

No

Tag.

Key

string

No

Kunci tag Sumber daya. Anda dapat menentukan hingga 20 kunci tag. Kunci tag tidak boleh berupa string kosong.

Panjang kunci tag dapat mencapai 128 karakter dan tidak boleh diawali dengan aliyun atau acs:. Tidak boleh mengandung http:// atau https://.

FinanceDept

Value

string

No

Nilai tag Sumber daya. Anda dapat menentukan hingga 20 nilai tag. Nilai tag dapat berupa string kosong.

Panjang nilai tag dapat mencapai 128 karakter dan tidak boleh diawali dengan aliyun atau acs:. Tidak boleh mengandung http:// atau https://.

FinanceJoshua

IpVersion

string

No

Versi IP Trafik yang ditangkap oleh log aliran.

IPv4

Elemen respons

Element

Type

Description

Example

object

ID permintaan.

RequestId

string

ID permintaan.

54B48E3D-DF70-471B-AA93-08E683A1B457

Success

string

Apakah panggilan berhasil. Nilai valid:

  • true: Panggilan berhasil.

  • false: Panggilan gagal.

true

FlowLogId

string

ID log aliran.

fl-m5e8vhz2t21sel1nq****

ResourceGroupId

string

ID kelompok sumber daya.

rg-acfmxazdjdhd****

Contoh

Respons sukses

JSONformat

{
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B457",
  "Success": "true",
  "FlowLogId": "fl-m5e8vhz2t21sel1nq****",
  "ResourceGroupId": "rg-acfmxazdjdhd****"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 IncorrectBusinessStatus.FlowLog The business status of flowLog is incorrect. The current business status does not support creating a flow log instance.
400 OptInRequired.FlowLog You are not authorized to use the requested service of flowLog. Ensure that you have subscribed to the service you are trying to use. You are not authorized to use the requested flowLog service. Ensure that you have subscribed to the service you are trying to use.
400 OperationUnsupported.AdvancedFeature Advanced features of the vpc is unsupported. The advanced feature is not supported.
400 InvalidInstanceId vswitch does not exist. The vSwitch instance does not exist.
400 ProjectOrLogstoreNotExist The specified project or logstore does not exist. The specified project or Logstore does not exist.
400 SourceProjectNotExist The Source Project or logstore does not exist. The source SLS project or Logstore does not exist.
400 Unauthorized This api does not support sub user or role. This API does not support RAM users or RAM roles.
400 OperationUnsupported.action This action is not support. This action is not supported.
400 ParameterInvalid Invalid parameter. Invalid input parameter.
400 RuleExist The rule has already existed.
400 InvalidHdMonitorStatus Current instance status is not valid for this action.
400 QuotaExceeded.FlowlogCount This user has reached the maximum instance number of flowlog. The maximum number of flow log instances for this user has been reached.
400 InvalidResourceId.NotFound This resourceId already has flowlog instance existed. A flow log instance already exists for the specified resource.
400 INVALID_PARAMETER The parameter invalid.
400 MissingParameter Missing mandatory parameter
400 InvalidRegionId.NotFound The RegionId provided does not exist in our records.
400 InvalidResourceType.NotFound Resource type no the same.
400 OperationUnsupported.ResourceType This resource type is not supported.
400 IllegalParam.AggregationInterval The param of aggregationInterval is illegal. The sampling interval parameter is invalid.
400 UnsupportedFeature.UserDefinedTrafficPath The feature of UserDefinedTrafficPath is not supported. The user does not support the custom flow log trafficPath feature.
400 IllegalParam.TrafficPath The param of trafficPath is illegal. The specified trafficPath parameter is invalid.
400 DuplicatedParam.TrafficPath The param of trafficPath is duplicated. The specified trafficPath parameter contains duplicate values.
400 IllegalParam.ResourceGroupId Invalid ResourceGroupld value. The specified resource group is invalid or does not exist.
400 OperationDenied.OperateShareResource The operation is not allowed because of OperateShareResource. The operation failed because a shared resource was operated.
400 UnsupportedFeature.IpVersion The ipversion type is not supported. The specified ipVersion is not supported.
400 UnsupportedFeature.VpcAdvancedFeature The VPC does not support some advanced features. The VPC does not support some advanced features. Submit a ticket to handle this issue.
400 OperationFailed.EniTypeNotSupport Operation failed because the ENI type is not supported. The current operation is not supported by the type of secondary ENI.
400 IllegalParam.IpVersion The parameter of IpVersion is illegal. The IpVersion parameter is invalid.
400 OperationDenied.NisTrafficAnalyzerAggregationIntervalMismatch The sampling interval of the FlowLog is greater than the sampling interval of the NIS Traffic Analyzer. The sampling interval of the FlowLog is greater than the sampling interval of the NIS Traffic Analyzer.
400 OperationDenied.NisTrafficAnalyzerNotFound The specified NIS Traffic Analyzer does not exist. The specified NIS Traffic Analyzer does not exist.
400 OperationDenied.NisTrafficAnalyzerNotActive The specified NIS Traffic Analyzer is not enabled. The specified NIS Traffic Analyzer is not enabled.
400 OperationFailed.InternalError The request processing has failed due to some unknown error. An unknown error occurred. Try the operation again. If the error persists, submit a ticket.
400 MissingParam.TrafficAnalyzerIdOrLogProjectOrLogStore TrafficAnalyzerId and ProjectName and LogStoreName parameters are not passed in. The TrafficAnalyzerId, ProjectName, and LogStoreName parameters are not specified.
400 OperationDenied.AllTrafficPathOfManagedExist The resource you specified has created a flow log instance that collects the traffic of all scenarios. You cannot create a flow log instance that collects only some scenarios. The specified resource already has a flow log instance that collects the traffic of all scenarios. You cannot create a flow log instance that collects only some scenarios.
400 UnsupportedFeature.UserDefinedTrafficPathIpv6 Dual-stack flow log instances do not support custom trafficPath. Dual-stack flow log instances do not support the custom trafficPath feature.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.