Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma Cloud Minimal Response #32606

Merged
merged 33 commits into from Feb 4, 2024
Merged

Prisma Cloud Minimal Response #32606

merged 33 commits into from Feb 4, 2024

Conversation

tkatzir
Copy link
Contributor

@tkatzir tkatzir commented Feb 1, 2024

Support minimizing Prisma Cloud output size in prisma-cloud-config-search

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

fixes: https://jira-dc.paloaltonetworks.com/browse/CIAC-9646

@tkatzir tkatzir marked this pull request as ready for review February 1, 2024 13:04
@ShirleyDenkberg
Copy link
Contributor

@anara123 @BEAdi Doc review completed.

tkatzir and others added 5 commits February 1, 2024 17:26
Co-authored-by: ShirleyDenkberg <62508050+ShirleyDenkberg@users.noreply.github.com>
Co-authored-by: ShirleyDenkberg <62508050+ShirleyDenkberg@users.noreply.github.com>
Co-authored-by: ShirleyDenkberg <62508050+ShirleyDenkberg@users.noreply.github.com>
@@ -200,17 +200,33 @@ def remediation_command_list_request(self, time_range: Dict[str, Any], alert_ids
def alert_remediate_request(self, alert_id: str):
self._http_request('PATCH', f'alert/remediation/{alert_id}', resp_type='response')

def remove_additional_resource_fields(self, input_dict, keys):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid recursion. instead lets just delete the fields one by one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields could appear several times, and I need to modify the object as I go.

Copy link
Contributor

@anara123 anara123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comment

@@ -1520,3 +1522,22 @@ def test_update_remote_system_command(mocker, prisma_cloud_v2_mirroring_client,

assert mock_update_remote_alert.call_count == expected_call_count
assert result == 'P-1111111'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add more broad test where passing, include_resource_json=false will return response without the two additional fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current test tests both remove and non-removed fields.
Testing the calling method means using mocking, which will not test my new code.

@tkatzir tkatzir requested a review from BEAdi February 4, 2024 07:55
tkatzir and others added 4 commits February 4, 2024 10:50
Co-authored-by: Adi Bamberger Edri <72088126+BEAdi@users.noreply.github.com>
…t.py

Co-authored-by: Adi Bamberger Edri <72088126+BEAdi@users.noreply.github.com>
@tkatzir tkatzir merged commit b2c9815 into master Feb 4, 2024
16 checks passed
@tkatzir tkatzir deleted the prisma-cloud-minimal-response branch February 4, 2024 10:44
yasta5 pushed a commit that referenced this pull request Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants