Scalr\Service\Aws\Ec2\V20140615\Ec2Api::revokeSecurityGroupEgress PHP Метод

revokeSecurityGroupEgress() публичный Метод

Removes one or more egress rules from a security group for EC2-VPC. The values that you specify in the revoke request (for example, ports) must match the existing rule's values for the rule to be revoked. Each rule consists of the protocol and the CIDR range or destination security group. For the TCP and UDP protocols, you must also specify the destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type and code. Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.
public revokeSecurityGroupEgress ( Scalr\Service\Aws\Ec2\DataType\IpPermissionList $ipPermissions, string $groupId ) : boolean
$ipPermissions Scalr\Service\Aws\Ec2\DataType\IpPermissionList Ip permission list object
$groupId string optional The ID of the security group to modify.
Результат boolean Returns true on success
    public function revokeSecurityGroupEgress(IpPermissionList $ipPermissions, $groupId)
    {
        $result = false;
        $options = $ipPermissions->getQueryArrayBare('IpPermissions');
        $options['GroupId'] = (string) $groupId;
        $action = ucfirst(__FUNCTION__);
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if ((string) $sxml->return != 'true') {
                throw new Ec2Exception(sprintf('Amazon Ec2 could not %s GroupId:"%s". It returned "%s"', $action, $options['GroupId'], $sxml->return));
            }
            $result = true;
        }
        return $result;
    }
Ec2Api