ConnectionAnalyzerEndpoint Class

  • java.lang.Object
    • com.azure.resourcemanager.network.models.ConnectionAnalyzerEndpoint

Implements

public final class ConnectionAnalyzerEndpoint
implements JsonSerializable<ConnectionAnalyzerEndpoint>

Describes a source or destination endpoint of a connection analyzer. The schema is intentionally permissive (a flat object) because the set of valid fields is determined by `type` and is enforced server-side by the Network Resource Provider. The required and allowed fields per `type` are: - `VM`, `VMSS`, `BastionHost`, `ApplicationGateway`: `resourceId` is required and must be the ARM resource ID of the corresponding resource (a virtual machine, virtual machine scale set or VMSS instance, Azure Bastion host, or Application Gateway, respectively); `address` is not used; `port` is optional. - `ExternalAddress`: `address` is required and must be an IP address or FQDN reachable from outside Azure; `resourceId` is not used; `port` is optional. Requests that supply fields not allowed for the chosen `type`, or omit a required field, are rejected by the service with a validation error. This follows the same convention used by `ConnectivitySource` and `ConnectivityDestination` on Network Watcher.

Constructor Summary

Constructor Description
ConnectionAnalyzerEndpoint()

Creates an instance of ConnectionAnalyzerEndpoint class.

Method Summary

Modifier and Type Method and Description
String address()

Get the address property: IP address or FQDN of the endpoint.

static ConnectionAnalyzerEndpoint fromJson(JsonReader jsonReader)

Reads an instance of ConnectionAnalyzerEndpoint from the JsonReader.

Integer port()

Get the port property: Port to use for the endpoint (0-65535).

String resourceId()

Get the resourceId property: ARM resource ID of the endpoint resource.

JsonWriter toJson(JsonWriter jsonWriter)
ConnectionAnalyzerEndpointType type()

Get the type property: The type of the endpoint.

void validate()

Validates the instance.

ConnectionAnalyzerEndpoint withAddress(String address)

Set the address property: IP address or FQDN of the endpoint.

ConnectionAnalyzerEndpoint withPort(Integer port)

Set the port property: Port to use for the endpoint (0-65535).

ConnectionAnalyzerEndpoint withResourceId(String resourceId)

Set the resourceId property: ARM resource ID of the endpoint resource.

ConnectionAnalyzerEndpoint withType(ConnectionAnalyzerEndpointType type)

Set the type property: The type of the endpoint.

Methods inherited from java.lang.Object

Constructor Details

ConnectionAnalyzerEndpoint

public ConnectionAnalyzerEndpoint()

Creates an instance of ConnectionAnalyzerEndpoint class.

Method Details

address

public String address()

Get the address property: IP address or FQDN of the endpoint. Required when `type` is `ExternalAddress`. Not used for the resource-typed endpoint kinds (`VM`, `VMSS`, `BastionHost`, `ApplicationGateway`).

Returns:

the address value.

fromJson

public static ConnectionAnalyzerEndpoint fromJson(JsonReader jsonReader)

Reads an instance of ConnectionAnalyzerEndpoint from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ConnectionAnalyzerEndpoint if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

port

public Integer port()

Get the port property: Port to use for the endpoint (0-65535).

Returns:

the port value.

resourceId

public String resourceId()

Get the resourceId property: ARM resource ID of the endpoint resource. Required when `type` is `VM`, `VMSS`, `BastionHost`, or `ApplicationGateway`. Not used when `type` is `ExternalAddress`.

Returns:

the resourceId value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public ConnectionAnalyzerEndpointType type()

Get the type property: The type of the endpoint. Determines which of `resourceId` and `address` are required; see the model-level documentation for the per-type contract.

Returns:

the type value.

validate

public void validate()

Validates the instance.

withAddress

public ConnectionAnalyzerEndpoint withAddress(String address)

Set the address property: IP address or FQDN of the endpoint. Required when `type` is `ExternalAddress`. Not used for the resource-typed endpoint kinds (`VM`, `VMSS`, `BastionHost`, `ApplicationGateway`).

Parameters:

address - the address value to set.

Returns:

the ConnectionAnalyzerEndpoint object itself.

withPort

public ConnectionAnalyzerEndpoint withPort(Integer port)

Set the port property: Port to use for the endpoint (0-65535).

Parameters:

port - the port value to set.

Returns:

the ConnectionAnalyzerEndpoint object itself.

withResourceId

public ConnectionAnalyzerEndpoint withResourceId(String resourceId)

Set the resourceId property: ARM resource ID of the endpoint resource. Required when `type` is `VM`, `VMSS`, `BastionHost`, or `ApplicationGateway`. Not used when `type` is `ExternalAddress`.

Parameters:

resourceId - the resourceId value to set.

Returns:

the ConnectionAnalyzerEndpoint object itself.

withType

public ConnectionAnalyzerEndpoint withType(ConnectionAnalyzerEndpointType type)

Set the type property: The type of the endpoint. Determines which of `resourceId` and `address` are required; see the model-level documentation for the per-type contract.

Parameters:

type - the type value to set.

Returns:

the ConnectionAnalyzerEndpoint object itself.

Applies to