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

Commit

Permalink
Add resource for gcp project iam policy
Browse files Browse the repository at this point in the history
  • Loading branch information
jceresini committed Mar 18, 2019
1 parent 175dfd7 commit da0bd5f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions micromanager/resources/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def factory(resource_data, **kargs):
resource_type_map = {
'bigquery.datasets': GcpBigqueryDataset,
'compute.instances': GcpComputeInstance,
'cloudresourcemanager.projects.iam': GcpProjectIam,
'sqladmin.instances': GcpSqlInstance,
'storage.buckets': GcpStorageBucket,
'storage.buckets.iam': GcpStorageBucketIamPolicy
Expand Down Expand Up @@ -158,3 +159,23 @@ def _update_request_args(self, body):
'project': self.resource_data['project_id'],
'body': body
}


class GcpProjectIam(GoogleAPIResource):

service_name = "cloudresourcemanager"
resource_path = "projects"
version = "v1"
get_method = "getIamPolicy"
update_method = "setIamPolicy"

def _get_request_args(self):
return {
'resource': self.resource_data['resource_name']
}

def _update_request_args(self, body):
return {
'resource': self.resource_data['resource_name'],
'body': body
}

0 comments on commit da0bd5f

Please sign in to comment.