## Get PCAP request `client.MagicTransit.PCAPs.Get(ctx, pcapID, query) (*PCAPGetResponse, error)` **get** `/accounts/{account_id}/pcaps/{pcap_id}` Get information for a PCAP request by id. ### Parameters - `pcapID string` Identifier. - `query PCAPGetParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type PCAPGetResponse interface{…}` - `type PCAP struct{…}` - `ID string` The ID for the packet capture. - `FilterV1 PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `DestinationAddress string` The destination IP address of the packet. - `DestinationPort float64` The destination port of the packet. - `Protocol float64` The protocol number of the packet. - `SourceAddress string` The source IP address of the packet. - `SourcePort float64` The source port of the packet. - `OffsetTime Time` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `Status PCAPStatus` The status of the packet capture request. - `const PCAPStatusUnknown PCAPStatus = "unknown"` - `const PCAPStatusSuccess PCAPStatus = "success"` - `const PCAPStatusPending PCAPStatus = "pending"` - `const PCAPStatusRunning PCAPStatus = "running"` - `const PCAPStatusConversionPending PCAPStatus = "conversion_pending"` - `const PCAPStatusConversionRunning PCAPStatus = "conversion_running"` - `const PCAPStatusComplete PCAPStatus = "complete"` - `const PCAPStatusFailed PCAPStatus = "failed"` - `Submitted string` The RFC 3339 timestamp when the packet capture was created. - `System PCAPSystem` The system used to collect packet captures. - `const PCAPSystemMagicTransit PCAPSystem = "magic-transit"` - `TimeLimit float64` The packet capture duration in seconds. - `Type PCAPType` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `const PCAPTypeSimple PCAPType = "simple"` - `const PCAPTypeFull PCAPType = "full"` - `type PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFull struct{…}` - `ID string` The ID for the packet capture. - `ByteLimit float64` The maximum number of bytes to capture. This field only applies to `full` packet captures. - `ColoName string` The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. - `DestinationConf string` The full URI for the bucket. This field only applies to `full` packet captures. - `ErrorMessage string` An error message that describes why the packet capture failed. This field only applies to `full` packet captures. - `FilterV1 PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `PacketsCaptured int64` The number of packets captured. - `Status PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus` The status of the packet capture request. - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatusUnknown PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus = "unknown"` - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatusSuccess PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus = "success"` - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatusPending PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus = "pending"` - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatusRunning PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus = "running"` - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatusConversionPending PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus = "conversion_pending"` - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatusConversionRunning PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus = "conversion_running"` - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatusComplete PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus = "complete"` - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatusFailed PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullStatus = "failed"` - `StopRequested Time` The RFC 3339 timestamp when stopping the packet capture was requested. This field only applies to `full` packet captures. - `Submitted string` The RFC 3339 timestamp when the packet capture was created. - `System PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullSystem` The system used to collect packet captures. - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullSystemMagicTransit PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullSystem = "magic-transit"` - `TimeLimit float64` The packet capture duration in seconds. - `Type PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullType` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullTypeSimple PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullType = "simple"` - `const PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullTypeFull PCAPGetResponseMagicVisibilityPCAPsPCAPsResponseFullType = "full"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/magic_transit" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) pcap, err := client.MagicTransit.PCAPs.Get( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.PCAPGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", pcap) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "66802ca5668e47a2b82c2e6746e45037", "filter_v1": { "destination_address": "1.2.3.4", "destination_port": 80, "protocol": 6, "source_address": "1.2.3.4", "source_port": 123 }, "offset_time": "2020-01-01T08:00:00Z", "status": "success", "submitted": "2020-01-01T08:00:00Z", "system": "magic-transit", "time_limit": 300, "type": "simple" }, "success": true } ```