Skip to content

vendor_connectors.google.cloud

Google Cloud Platform resource management operations.

This module provides operations for managing Google Cloud organizations, folders, projects, and IAM.

GoogleCloudMixinMixin providing Google Cloud Platform operations.

class vendor_connectors.google.cloud.GoogleCloudMixin

Section titled “class vendor_connectors.google.cloud.GoogleCloudMixin”

Mixin providing Google Cloud Platform operations.

This mixin requires the base GoogleConnector class to provide:

  • get_cloud_resource_manager_service()
  • get_iam_service()
  • logger

Get the Google Cloud organization ID.

Returns: The organization ID (numeric string).

Raises: RuntimeError: If no organization is found.

Get the Google Cloud organization details.

Returns: Organization dictionary.

Raises: RuntimeError: If no organization is found.

List Google Cloud projects.

Args: parent: Parent resource (organizations/ORG_ID or folders/FOLDER_ID). filter_query: Optional filter query string. unhump_projects: Convert keys to snake_case. Defaults to False.

Returns: List of project dictionaries.

Get a specific Google Cloud project.

Args: project_id: The project ID.

Returns: Project dictionary or None if not found.

Create a Google Cloud project.

Args: project_id: Unique project ID. display_name: Human-readable project name. parent: Parent resource (organizations/ORG_ID or folders/FOLDER_ID). labels: Optional project labels.

Returns: Operation response dictionary.

Delete a Google Cloud project.

Args: project_id: The project ID to delete.

Returns: Operation response dictionary.

Move a project to a different folder/organization.

Args: project_id: The project ID to move. destination_parent: Destination (organizations/ORG_ID or folders/FOLDER_ID).

Returns: Operation response dictionary.

List folders under a parent.

Args: parent: Parent resource (organizations/ORG_ID or folders/FOLDER_ID). unhump_folders: Convert keys to snake_case. Defaults to False.

Returns: List of folder dictionaries.

Get an organization policy.

Args: resource: Resource name (organizations/ORG_ID, folders/FOLDER_ID, projects/PROJECT_ID). constraint: Policy constraint name.

Returns: Policy dictionary or None if not set.

Set an organization policy.

Args: resource: Resource name (organizations/ORG_ID, folders/FOLDER_ID, projects/PROJECT_ID). policy: Policy dictionary.

Returns: Updated policy dictionary.

Get IAM policy for a resource.

Args: resource: Resource ID. resource_type: Type of resource (projects, folders, organizations).

Returns: IAM policy dictionary.

Set IAM policy for a resource.

Args: resource: Resource ID. policy: IAM policy dictionary. resource_type: Type of resource (projects, folders, organizations).

Returns: Updated IAM policy dictionary.

Add an IAM binding to a resource.

Args: resource: Resource ID. role: IAM role to grant. member: Member to grant role to (user:, group:, serviceAccount:). resource_type: Type of resource (projects, folders, organizations).

Returns: Updated IAM policy dictionary.

List service accounts in a project.

Args: project_id: The project ID. unhump_accounts: Convert keys to snake_case. Defaults to False.

Returns: List of service account dictionaries.

Create a service account in a project.

Args: project_id: The project ID. account_id: Unique account ID (alphanumeric, 6-30 chars). display_name: Human-readable name. description: Optional description.

Returns: Created service account dictionary.