packetcaptures

package
v0.20241029.1112340 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/packetcaptures Documentation

The packetcaptures SDK allows for interaction with Azure Resource Manager network (API Version 2023-09-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/packetcaptures"

Client Initialization

client := packetcaptures.NewPacketCapturesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PacketCapturesClient.Create

ctx := context.TODO()
id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherName", "packetCaptureName")

payload := packetcaptures.PacketCapture{
	// ...
}


if err := client.CreateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: PacketCapturesClient.Delete

ctx := context.TODO()
id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherName", "packetCaptureName")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: PacketCapturesClient.Get

ctx := context.TODO()
id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherName", "packetCaptureName")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PacketCapturesClient.GetStatus

ctx := context.TODO()
id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherName", "packetCaptureName")

if err := client.GetStatusThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: PacketCapturesClient.List

ctx := context.TODO()
id := packetcaptures.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherName")

read, err := client.List(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PacketCapturesClient.Stop

ctx := context.TODO()
id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherName", "packetCaptureName")

if err := client.StopThenPoll(ctx, id); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForPacketCaptureTargetType

func PossibleValuesForPacketCaptureTargetType() []string

func PossibleValuesForPcError

func PossibleValuesForPcError() []string

func PossibleValuesForPcProtocol

func PossibleValuesForPcProtocol() []string

func PossibleValuesForPcStatus

func PossibleValuesForPcStatus() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func ValidateNetworkWatcherID

func ValidateNetworkWatcherID(input interface{}, key string) (warnings []string, errors []error)

ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID

func ValidatePacketCaptureID

func ValidatePacketCaptureID(input interface{}, key string) (warnings []string, errors []error)

ValidatePacketCaptureID checks that 'input' can be parsed as a Packet Capture ID

Types

type CreateOperationResponse

type CreateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PacketCaptureResult
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PacketCaptureResult
}

type GetStatusOperationResponse

type GetStatusOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PacketCaptureQueryStatusResult
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PacketCaptureListResult
}

type NetworkWatcherId

type NetworkWatcherId struct {
	SubscriptionId     string
	ResourceGroupName  string
	NetworkWatcherName string
}

NetworkWatcherId is a struct representing the Resource ID for a Network Watcher

func NewNetworkWatcherID

func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId

NewNetworkWatcherID returns a new NetworkWatcherId struct

func ParseNetworkWatcherID

func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error)

ParseNetworkWatcherID parses 'input' into a NetworkWatcherId

func ParseNetworkWatcherIDInsensitively

func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error)

ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId note: this method should only be used for API response data and not user input

func (*NetworkWatcherId) FromParseResult

func (id *NetworkWatcherId) FromParseResult(input resourceids.ParseResult) error

func (NetworkWatcherId) ID

func (id NetworkWatcherId) ID() string

ID returns the formatted Network Watcher ID

func (NetworkWatcherId) Segments

func (id NetworkWatcherId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID

func (NetworkWatcherId) String

func (id NetworkWatcherId) String() string

String returns a human-readable description of this Network Watcher ID

type PacketCapture

type PacketCapture struct {
	Properties PacketCaptureParameters `json:"properties"`
}

type PacketCaptureFilter

type PacketCaptureFilter struct {
	LocalIPAddress  *string     `json:"localIPAddress,omitempty"`
	LocalPort       *string     `json:"localPort,omitempty"`
	Protocol        *PcProtocol `json:"protocol,omitempty"`
	RemoteIPAddress *string     `json:"remoteIPAddress,omitempty"`
	RemotePort      *string     `json:"remotePort,omitempty"`
}

type PacketCaptureId

type PacketCaptureId struct {
	SubscriptionId     string
	ResourceGroupName  string
	NetworkWatcherName string
	PacketCaptureName  string
}

PacketCaptureId is a struct representing the Resource ID for a Packet Capture

func NewPacketCaptureID

func NewPacketCaptureID(subscriptionId string, resourceGroupName string, networkWatcherName string, packetCaptureName string) PacketCaptureId

NewPacketCaptureID returns a new PacketCaptureId struct

func ParsePacketCaptureID

func ParsePacketCaptureID(input string) (*PacketCaptureId, error)

ParsePacketCaptureID parses 'input' into a PacketCaptureId

func ParsePacketCaptureIDInsensitively

func ParsePacketCaptureIDInsensitively(input string) (*PacketCaptureId, error)

ParsePacketCaptureIDInsensitively parses 'input' case-insensitively into a PacketCaptureId note: this method should only be used for API response data and not user input

func (*PacketCaptureId) FromParseResult

func (id *PacketCaptureId) FromParseResult(input resourceids.ParseResult) error

func (PacketCaptureId) ID

func (id PacketCaptureId) ID() string

ID returns the formatted Packet Capture ID

func (PacketCaptureId) Segments

func (id PacketCaptureId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Packet Capture ID

func (PacketCaptureId) String

func (id PacketCaptureId) String() string

String returns a human-readable description of this Packet Capture ID

type PacketCaptureListResult

type PacketCaptureListResult struct {
	Value *[]PacketCaptureResult `json:"value,omitempty"`
}

type PacketCaptureMachineScope

type PacketCaptureMachineScope struct {
	Exclude *[]string `json:"exclude,omitempty"`
	Include *[]string `json:"include,omitempty"`
}

type PacketCaptureParameters

type PacketCaptureParameters struct {
	BytesToCapturePerPacket *int64                       `json:"bytesToCapturePerPacket,omitempty"`
	Filters                 *[]PacketCaptureFilter       `json:"filters,omitempty"`
	Scope                   *PacketCaptureMachineScope   `json:"scope,omitempty"`
	StorageLocation         PacketCaptureStorageLocation `json:"storageLocation"`
	Target                  string                       `json:"target"`
	TargetType              *PacketCaptureTargetType     `json:"targetType,omitempty"`
	TimeLimitInSeconds      *int64                       `json:"timeLimitInSeconds,omitempty"`
	TotalBytesPerSession    *int64                       `json:"totalBytesPerSession,omitempty"`
}

type PacketCaptureQueryStatusResult

type PacketCaptureQueryStatusResult struct {
	CaptureStartTime    *string    `json:"captureStartTime,omitempty"`
	Id                  *string    `json:"id,omitempty"`
	Name                *string    `json:"name,omitempty"`
	PacketCaptureError  *[]PcError `json:"packetCaptureError,omitempty"`
	PacketCaptureStatus *PcStatus  `json:"packetCaptureStatus,omitempty"`
	StopReason          *string    `json:"stopReason,omitempty"`
}

func (*PacketCaptureQueryStatusResult) GetCaptureStartTimeAsTime

func (o *PacketCaptureQueryStatusResult) GetCaptureStartTimeAsTime() (*time.Time, error)

func (*PacketCaptureQueryStatusResult) SetCaptureStartTimeAsTime

func (o *PacketCaptureQueryStatusResult) SetCaptureStartTimeAsTime(input time.Time)

type PacketCaptureResult

type PacketCaptureResult struct {
	Etag       *string                        `json:"etag,omitempty"`
	Id         *string                        `json:"id,omitempty"`
	Name       *string                        `json:"name,omitempty"`
	Properties *PacketCaptureResultProperties `json:"properties,omitempty"`
}

type PacketCaptureResultProperties

type PacketCaptureResultProperties struct {
	BytesToCapturePerPacket *int64                       `json:"bytesToCapturePerPacket,omitempty"`
	Filters                 *[]PacketCaptureFilter       `json:"filters,omitempty"`
	ProvisioningState       *ProvisioningState           `json:"provisioningState,omitempty"`
	Scope                   *PacketCaptureMachineScope   `json:"scope,omitempty"`
	StorageLocation         PacketCaptureStorageLocation `json:"storageLocation"`
	Target                  string                       `json:"target"`
	TargetType              *PacketCaptureTargetType     `json:"targetType,omitempty"`
	TimeLimitInSeconds      *int64                       `json:"timeLimitInSeconds,omitempty"`
	TotalBytesPerSession    *int64                       `json:"totalBytesPerSession,omitempty"`
}

type PacketCaptureStorageLocation

type PacketCaptureStorageLocation struct {
	FilePath    *string `json:"filePath,omitempty"`
	StorageId   *string `json:"storageId,omitempty"`
	StoragePath *string `json:"storagePath,omitempty"`
}

type PacketCaptureTargetType

type PacketCaptureTargetType string
const (
	PacketCaptureTargetTypeAzureVM   PacketCaptureTargetType = "AzureVM"
	PacketCaptureTargetTypeAzureVMSS PacketCaptureTargetType = "AzureVMSS"
)

func (*PacketCaptureTargetType) UnmarshalJSON

func (s *PacketCaptureTargetType) UnmarshalJSON(bytes []byte) error

type PacketCapturesClient

type PacketCapturesClient struct {
	Client *resourcemanager.Client
}

func NewPacketCapturesClientWithBaseURI

func NewPacketCapturesClientWithBaseURI(sdkApi sdkEnv.Api) (*PacketCapturesClient, error)

func (PacketCapturesClient) Create

Create ...

func (PacketCapturesClient) CreateThenPoll

func (c PacketCapturesClient) CreateThenPoll(ctx context.Context, id PacketCaptureId, input PacketCapture) error

CreateThenPoll performs Create then polls until it's completed

func (PacketCapturesClient) Delete

Delete ...

func (PacketCapturesClient) DeleteThenPoll

func (c PacketCapturesClient) DeleteThenPoll(ctx context.Context, id PacketCaptureId) error

DeleteThenPoll performs Delete then polls until it's completed

func (PacketCapturesClient) Get

Get ...

func (PacketCapturesClient) GetStatus

GetStatus ...

func (PacketCapturesClient) GetStatusThenPoll

func (c PacketCapturesClient) GetStatusThenPoll(ctx context.Context, id PacketCaptureId) error

GetStatusThenPoll performs GetStatus then polls until it's completed

func (PacketCapturesClient) List

List ...

func (PacketCapturesClient) Stop

Stop ...

func (PacketCapturesClient) StopThenPoll

func (c PacketCapturesClient) StopThenPoll(ctx context.Context, id PacketCaptureId) error

StopThenPoll performs Stop then polls until it's completed

type PcError

type PcError string
const (
	PcErrorAgentStopped    PcError = "AgentStopped"
	PcErrorCaptureFailed   PcError = "CaptureFailed"
	PcErrorInternalError   PcError = "InternalError"
	PcErrorLocalFileFailed PcError = "LocalFileFailed"
	PcErrorStorageFailed   PcError = "StorageFailed"
)

func (*PcError) UnmarshalJSON

func (s *PcError) UnmarshalJSON(bytes []byte) error

type PcProtocol

type PcProtocol string
const (
	PcProtocolAny PcProtocol = "Any"
	PcProtocolTCP PcProtocol = "TCP"
	PcProtocolUDP PcProtocol = "UDP"
)

func (*PcProtocol) UnmarshalJSON

func (s *PcProtocol) UnmarshalJSON(bytes []byte) error

type PcStatus

type PcStatus string
const (
	PcStatusError      PcStatus = "Error"
	PcStatusNotStarted PcStatus = "NotStarted"
	PcStatusRunning    PcStatus = "Running"
	PcStatusStopped    PcStatus = "Stopped"
	PcStatusUnknown    PcStatus = "Unknown"
)

func (*PcStatus) UnmarshalJSON

func (s *PcStatus) UnmarshalJSON(bytes []byte) error

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error

type StopOperationResponse

type StopOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL