# Network Services V1 API - Class Google::Cloud::NetworkServices::V1::TrafficPortSelector (v2.10.1)

2.10.1 (latest) 2.10.0 2.9.0 2.8.0 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.1 1.2.0 1.1.0 1.0.1 0.2.0 0.1.0 Reference documentation and code samples for the Network Services V1 API class Google::Cloud::NetworkServices::V1::TrafficPortSelector.

Specification of a port-based selector.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #ports

    def ports() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Optional. A list of ports. Can be port numbers or port range (example, \[80-90\] specifies all ports from 80 to 90, including 80 and 90) or named ports or \* to specify all ports. If the list is empty, all ports are selected.

### #ports=

    def ports=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Optional. A list of ports. Can be port numbers or port range (example, \[80-90\] specifies all ports from 80 to 90, including 80 and 90) or named ports or \* to specify all ports. If the list is empty, all ports are selected.
**Returns**

- (::Array\<::String\>) --- Optional. A list of ports. Can be port numbers or port range (example, \[80-90\] specifies all ports from 80 to 90, including 80 and 90) or named ports or \* to specify all ports. If the list is empty, all ports are selected.