Reference documentation and code samples for the Google Cloud Security Command Center V2 Client class IpRule.
IP rule information.
Generated from protobuf messagegoogle.cloud.securitycenter.v2.IpRule
Namespace
Google \ Cloud \ SecurityCenter \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ protocol
string
The IP protocol this rule applies to. This value can either be one of the following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP, SCTP) or a string representation of the integer value.
Optional. An optional list of ports to which this rule applies. This field is only applicable for the UDP or (S)TCP protocols. Each entry must be either an integer or a range including a min and max port number.
getProtocol
The IP protocol this rule applies to. This value can either be one of the
following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,
SCTP) or a string representation of the integer value.
Returns
Type
Description
string
setProtocol
The IP protocol this rule applies to. This value can either be one of the
following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,
SCTP) or a string representation of the integer value.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getPortRanges
Optional. An optional list of ports to which this rule applies. This field
is only applicable for the UDP or (S)TCP protocols. Each entry must be
either an integer or a range including a min and max port number.
Optional. An optional list of ports to which this rule applies. This field
is only applicable for the UDP or (S)TCP protocols. Each entry must be
either an integer or a range including a min and max port number.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Security Command Center V2 Client - Class IpRule (2.2.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.1 (latest)](/php/docs/reference/cloud-security-center/latest/V2.IpRule)\n- [2.2.0](/php/docs/reference/cloud-security-center/2.2.0/V2.IpRule)\n- [2.1.1](/php/docs/reference/cloud-security-center/2.1.1/V2.IpRule)\n- [2.0.4](/php/docs/reference/cloud-security-center/2.0.4/V2.IpRule)\n- [1.32.0](/php/docs/reference/cloud-security-center/1.32.0/V2.IpRule)\n- [1.31.0](/php/docs/reference/cloud-security-center/1.31.0/V2.IpRule)\n- [1.30.0](/php/docs/reference/cloud-security-center/1.30.0/V2.IpRule)\n- [1.29.0](/php/docs/reference/cloud-security-center/1.29.0/V2.IpRule)\n- [1.28.2](/php/docs/reference/cloud-security-center/1.28.2/V2.IpRule)\n- [1.21.0](/php/docs/reference/cloud-security-center/1.21.0/V2.IpRule)\n- [1.20.2](/php/docs/reference/cloud-security-center/1.20.2/V2.IpRule)\n- [1.19.1](/php/docs/reference/cloud-security-center/1.19.1/V2.IpRule)\n- [1.18.0](/php/docs/reference/cloud-security-center/1.18.0/V2.IpRule)\n- [1.17.0](/php/docs/reference/cloud-security-center/1.17.0/V2.IpRule)\n- [1.16.0](/php/docs/reference/cloud-security-center/1.16.0/V2.IpRule)\n- [1.15.1](/php/docs/reference/cloud-security-center/1.15.1/V2.IpRule)\n- [1.14.2](/php/docs/reference/cloud-security-center/1.14.2/V2.IpRule)\n- [1.13.1](/php/docs/reference/cloud-security-center/1.13.1/V2.IpRule) \nReference documentation and code samples for the Google Cloud Security Command Center V2 Client class IpRule.\n\nIP rule information.\n\nGenerated from protobuf message `google.cloud.securitycenter.v2.IpRule`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ SecurityCenter \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getProtocol\n\nThe IP protocol this rule applies to. This value can either be one of the\nfollowing well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,\nSCTP) or a string representation of the integer value.\n\n### setProtocol\n\nThe IP protocol this rule applies to. This value can either be one of the\nfollowing well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,\nSCTP) or a string representation of the integer value.\n\n### getPortRanges\n\nOptional. An optional list of ports to which this rule applies. This field\nis only applicable for the UDP or (S)TCP protocols. Each entry must be\neither an integer or a range including a min and max port number.\n\n### setPortRanges\n\nOptional. An optional list of ports to which this rule applies. This field\nis only applicable for the UDP or (S)TCP protocols. Each entry must be\neither an integer or a range including a min and max port number."]]