- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateProbeCommand
Create a probe within a monitor. Once you create a probe, and it begins monitoring your network traffic, you'll incur billing charges for that probe. This action requires the monitorName
parameter. Run ListMonitors
to get a list of monitor names. Note the name of the monitorName
you want to create the probe for.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { NetworkMonitorClient, CreateProbeCommand } from "@aws-sdk/client-networkmonitor"; // ES Modules import
// const { NetworkMonitorClient, CreateProbeCommand } = require("@aws-sdk/client-networkmonitor"); // CommonJS import
const client = new NetworkMonitorClient(config);
const input = { // CreateProbeInput
monitorName: "STRING_VALUE", // required
probe: { // ProbeInput
sourceArn: "STRING_VALUE", // required
destination: "STRING_VALUE", // required
destinationPort: Number("int"),
protocol: "TCP" || "ICMP", // required
packetSize: Number("int"),
tags: { // TagMap
"<keys>": "STRING_VALUE",
},
},
clientToken: "STRING_VALUE",
tags: {
"<keys>": "STRING_VALUE",
},
};
const command = new CreateProbeCommand(input);
const response = await client.send(command);
// { // CreateProbeOutput
// probeId: "STRING_VALUE",
// probeArn: "STRING_VALUE",
// sourceArn: "STRING_VALUE", // required
// destination: "STRING_VALUE", // required
// destinationPort: Number("int"),
// protocol: "TCP" || "ICMP", // required
// packetSize: Number("int"),
// addressFamily: "IPV4" || "IPV6",
// vpcId: "STRING_VALUE",
// state: "PENDING" || "ACTIVE" || "INACTIVE" || "ERROR" || "DELETING" || "DELETED",
// createdAt: new Date("TIMESTAMP"),
// modifiedAt: new Date("TIMESTAMP"),
// tags: { // TagMap
// "<keys>": "STRING_VALUE",
// },
// };
CreateProbeCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
monitorName Required | string | undefined | The name of the monitor to associated with the probe. |
probe Required | ProbeInput | undefined | Describes the details of an individual probe for a monitor. |
clientToken | string | undefined | Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request. |
tags | Record<string, string> | undefined | The list of key-value pairs created and assigned to the probe. |
CreateProbeCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
destination Required | string | undefined | The destination IP address for the monitor. This must be either an IPv4 or IPv6 address. |
protocol Required | Protocol | undefined | The protocol used for the network traffic between the |
sourceArn Required | string | undefined | The ARN of the probe. |
addressFamily | AddressFamily | undefined | Indicates whether the IP address is |
createdAt | Date | undefined | The time and date that the probe was created. |
destinationPort | number | undefined | The port associated with the |
modifiedAt | Date | undefined | The time and date when the probe was last modified. |
packetSize | number | undefined | The size of the packets sent between the source and destination. This must be a number between |
probeArn | string | undefined | The ARN of the probe. |
probeId | string | undefined | The ID of the probe for which details are returned. |
state | ProbeState | undefined | The state of the probe. |
tags | Record<string, string> | undefined | The list of key-value pairs assigned to the probe. |
vpcId | string | undefined | The ID of the source VPC or subnet. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
InternalServerException | server | The request processing has failed because of an unknown error, exception or failure. |
ResourceNotFoundException | client | The specified resource does not exist. |
ServiceQuotaExceededException | client | This request exceeds a service quota. |
ThrottlingException | client | The request was denied due to request throttling |
ValidationException | client | One of the parameters for the request is not valid. |
NetworkMonitorServiceException | Base exception class for all service exceptions from NetworkMonitor service. |