def delete(self, policy_id):
     """Delete a policy by ID.  Success returns None"""
     sanity.validate_object_id(policy_id)
     request = HttpHelper(self.session)
     delete_endpoint = "%s/%s" % (self.endpoint(), policy_id)
     request.delete(delete_endpoint)
     return None
Пример #2
0
 def delete(self, policy_id):
     """Delete a policy by ID.  Success returns None"""
     sanity.validate_object_id(policy_id)
     request = HttpHelper(self.session)
     delete_endpoint = "%s/%s" % (self.endpoint(), policy_id)
     request.delete(delete_endpoint)
     return None
    def delete(self, fim_policy_id, fim_baseline_id):
        """Delete a FIM baseline by ID

        Args:
            fim_policy_id (str): ID of FIM policy
            fim_baseline_id (str): ID of baseline to be deleted

        Returns:
            None if successful, exceptions throw otherwise.

        """

        sanity.validate_object_id([fim_policy_id, fim_baseline_id])
        request = HttpHelper(self.session)
        endpoint = "/v1/fim_policies/%s/baselines/%s" % (fim_policy_id,
                                                         fim_baseline_id)
        request.delete(endpoint)
        return None
Пример #4
0
    def delete(self, fim_policy_id, fim_baseline_id):
        """Delete a FIM baseline by ID

        Args:
            fim_policy_id (str): ID of FIM policy
            fim_baseline_id (str): ID of baseline to be deleted

        Returns:
            None if successful, exceptions throw otherwise.

        """

        sanity.validate_object_id([fim_policy_id, fim_baseline_id])
        request = HttpHelper(self.session)
        endpoint = "/v1/fim_policies/%s/baselines/%s" % (fim_policy_id,
                                                         fim_baseline_id)
        request.delete(endpoint)
        return None
Пример #5
0
    def delete(self, firewall_policy_id, firewall_rule_id):
        """Delete a firewall policy rule

        Args:
            firewall_policy_id (str): ID of firewall policy containing\
            the rule to be deleted
            firewall_rule_id (str): ID of firewall policy rule to delete

        Returns:
            None if successful.  Errors will throw exceptions.

        """

        sanity.validate_object_id([firewall_policy_id, firewall_rule_id])
        request = HttpHelper(self.session)
        endpoint = ("/v1/firewall_policies/%s/firewall_rules/%s" %
                    (firewall_policy_id, firewall_rule_id))
        request.delete(endpoint)
        return None
    def delete(self, server_id):
        """Deletes server indicated by server_id.

        Remember, deletion causes the removal of accociated security
        events and scan information.

        Args:
            server_id (str): ID of server to be deleted

        Returns:
            True if successful, throws exceptions otherwise.

        """

        sanity.validate_object_id(server_id)
        endpoint = "/v1/servers/%s" % server_id
        request = HttpHelper(self.session)
        request.delete(endpoint)
        # If no exception from request, we're successful
        return True
Пример #7
0
    def delete(self, server_id):
        """Deletes server indicated by server_id.

        Remember, deletion causes the removal of accociated security
        events and scan information.

        Args:
            server_id (str): ID of server to be deleted

        Returns:
            True if successful, throws exceptions otherwise.

        """

        sanity.validate_object_id(server_id)
        endpoint = "/v1/servers/%s" % server_id
        request = HttpHelper(self.session)
        request.delete(endpoint)
        # If no exception from request, we're successful
        return True
    def delete(self, group_id, **kwargs):
        """ Delete a server group.

        Args:
            group_id (str): ID of group to delete

        Keyword Args:
            force (bool): If set to True, the member servers from this group \
            will be moved to the parent group.

        Returns:
            None if successful, exceptions otherwise.

        """

        sanity.validate_object_id(group_id)
        endpoint = "/v1/groups/%s" % group_id
        request = HttpHelper(self.session)
        if ("force" in kwargs) and (kwargs["force"] is True):
            params = {"move_to_parent": "true"}
            request.delete(endpoint, params=params)
        else:
            request.delete(endpoint)
        return None
    def delete(self, group_id, **kwargs):
        """ Delete a server group.

        Args:
            group_id (str): ID of group to delete

        Keyword Args:
            force (bool): If set to True, the member servers from this group \
            will be moved to the parent group.

        Returns:
            None if successful, exceptions otherwise.

        """

        sanity.validate_object_id(group_id)
        endpoint = "/v1/groups/%s" % group_id
        request = HttpHelper(self.session)
        if ("force" in kwargs) and (kwargs["force"] is True):
            params = {"move_to_parent": "true"}
            request.delete(endpoint, params=params)
        else:
            request.delete(endpoint)
        return None