Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

New Cloud Asset API resources #2235

Merged
merged 5 commits into from Nov 12, 2018
Merged

New Cloud Asset API resources #2235

merged 5 commits into from Nov 12, 2018

Conversation

ahoying
Copy link
Collaborator

@ahoying ahoying commented Nov 10, 2018

Thanks for opening a Pull Request!

Here's a handy checklist to ensure your PR goes smoothly.

  • I signed Google's Contributor License Agreement
  • My code conforms to Google's python style.
  • My PR at a minimum doesn't decrease unit-test coverage (if applicable).
  • My PR has been functionally tested.
  • All of the unit-tests still pass.
  • Running pylint --rcfile=pylintrc passes.

These guidelines and more can be found in our contributing guidelines.

@codecov
Copy link

codecov bot commented Nov 10, 2018

Codecov Report

Merging #2235 into dev will increase coverage by 0.01%.
The diff coverage is 92.07%.

@@            Coverage Diff             @@
##              dev    #2235      +/-   ##
==========================================
+ Coverage   88.85%   88.87%   +0.01%     
==========================================
  Files         175      175              
  Lines       13348    13443      +95     
==========================================
+ Hits        11860    11947      +87     
- Misses       1488     1496       +8
Impacted Files Coverage Δ
google/cloud/forseti/common/gcp_api/compute.py 97.96% <100%> (+0.01%) ⬆️
.../cloud/forseti/services/model/importer/importer.py 91.25% <100%> (+0.05%) ⬆️
...cloud/forseti/services/inventory/base/resources.py 91.09% <84.21%> (-0.57%) ⬇️
...oogle/cloud/forseti/services/inventory/base/gcp.py 98.28% <93.75%> (-0.23%) ⬇️
.../forseti/services/inventory/base/cai_gcp_client.py 93.77% <97.43%> (+0.53%) ⬆️

Copy link
Contributor

@blueandgold blueandgold left a comment

Choose a reason for hiding this comment

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

Awesome, great to see more resources added!

@@ -348,6 +350,24 @@ def iter_compute_firewalls(self, project_number):
for rule in resources:
yield _fixup_resource_keys(rule, cai_to_gcp_key_map)

def iter_compute_forwardingrules(self, project_number):
Copy link
Contributor

Choose a reason for hiding this comment

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

added to doc

Copy link
Contributor

Choose a reason for hiding this comment

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

after double check I realized this already exists, so deleted

@@ -498,6 +550,25 @@ def iter_compute_networks(self, project_number):
for network in resources:
yield _fixup_resource_keys(network, cai_to_gcp_key_map)

def iter_compute_routers(self, project_number):
Copy link
Contributor

Choose a reason for hiding this comment

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

added to doc

@@ -932,6 +1003,43 @@ def fetch_iam_serviceaccount_iam_policy(self, name, unique_id):
# Service accounts with no IAM policy return an empty dict.
return {}

def iter_iam_organization_roles(self, org_id):
Copy link
Contributor

Choose a reason for hiding this comment

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

for role in resources:
yield role

def iter_iam_project_roles(self, project_id, project_number):
Copy link
Contributor

Choose a reason for hiding this comment

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

@angelsungoogle angelsungoogle mentioned this pull request Nov 15, 2018
6 tasks
joecheuk pushed a commit that referenced this pull request Dec 5, 2018
* Fetch IAM custom roles using Cloud Asset data.

* Fetch Pub/Sub Topics and IAM Policies from Cloud Asset data.

* Fetch additional Compute Engine resources from Cloud Asset data.

* compute.forwardingRule
* compute.instanceGroup
* compute.instanceGroupManager
* compute.router

* Fix flake8 errors.
@ahoying ahoying deleted the new-cai-resources branch December 21, 2018 00:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants