Agent Skillsgoogle/skills › workload-manager-basics

workload-manager-basics

GitHub

管理Google Cloud Workload Manager评估、规则及结果。通过公共客户端库或REST API执行最佳实践检查、创建评估、审查违规并导出至BigQuery,适用于自动化合规审计场景。

skills/cloud/workload-manager-basics/SKILL.md google/skills

Trigger Scenarios

需要检查工作负载是否符合Google Cloud最佳实践 创建或运行Workload Manager评估任务 审查资源违规项或导出评估结果到BigQuery 使用Python等客户端库自动化Workload Manager操作

Install

npx skills add google/skills --skill workload-manager-basics -g -y
More Options

Non-standard path

npx skills add https://github.com/google/skills/tree/main/skills/cloud/workload-manager-basics -g -y

Use without installing

npx skills use google/skills@workload-manager-basics

指定 Agent (Claude Code)

npx skills add google/skills --skill workload-manager-basics -a claude-code -g -y

安装 repo 全部 skill

npx skills add google/skills --all -g -y

预览 repo 内 skill

npx skills add google/skills --list

SKILL.md

Frontmatter
{
    "name": "workload-manager-basics",
    "metadata": {
        "category": "CloudObservabilityAndMonitoring"
    },
    "description": "Use this skill to manage Google Cloud Workload Manager evaluations, rules, scanned resources, and validation results by using public client libraries and the REST API. Use when you need to inspect workload best-practice rules, create and run evaluations for Google Cloud general best practices, SAP, SQL Server, or custom organizational rules, review violations, export results to BigQuery, or automate Workload Manager through client libraries because no service-specific public CLI or MCP server is available. Don't use for general Google Compute Engine instance management, VPC configuration, or standard IAM auditing."
}

Workload Manager Basics

Workload Manager validates enterprise workloads against Google Cloud best practices and recommendations. The public client libraries are centered on evaluations: define a resource scope, choose built-in or custom rules, run an evaluation, then inspect results and scanned resources.

Use This Flow

flowchart LR
    Rules["List rules"] --> Eval["Create or update evaluation"]
    Resources["Project, folder, or org scope"] --> Eval
    Eval --> Run["Run evaluation"]
    Run --> Results["Inspect evaluation results"]
    Results --> Remediate["Remediate findings"]
    Results --> Export["Optional BigQuery export"]

Core API Constraints

To ensure compatibility, security, and successful integration:

  • Public Surface Only: You MUST strictly interact with Workload Manager using the official public google-cloud-workloadmanager client library or the public REST API (workloadmanager.googleapis.com/v1).
  • No Internal or Undocumented APIs: Do NOT attempt to use internal RPC protocols, private service backends, or undocumented discovery mechanisms. They are not supported for public integrations and will fail.
  • No Service-Specific CLI: There is no public gcloud workload-manager CLI command group. Use gcloud only for authentication, IAM role assignment, and fetching raw REST tokens.
  • Sandbox Execution Robustness (Auth/Mock Fallbacks): When gcloud authentication or Workload Manager API calls fail in sandboxed or restricted environments (e.g., due to Context Aware Access token blocks, missing API enablement, or mock resources returning 404/403), immediately fall back to presenting example code and static findings from your references instead of entering retry loops. Present the correct client library code structure or REST API payload example, clearly explain the auth or resource limitation, and list typical rules or mock findings statically to satisfy the request.

Prerequisites

  1. Enable the Workload Manager API:

    gcloud services enable workloadmanager.googleapis.com --quiet
    
  2. Authenticate locally using Application Default Credentials (ADC) before using client libraries:

    gcloud auth application-default login
    
  3. Ensure the Workload Manager service agent has the required roles granted in your project (mandatory for API/client library usage, see IAM & Security).

  4. Grant the least-privileged role needed for the task. Start with roles/workloadmanager.viewer for read-only access to evaluation resources and use roles/workloadmanager.evaluationAdmin or roles/workloadmanager.admin only when creating, updating, running, or deleting evaluations.

Quick Client Library Example

Use the Python client library for the first working automation path:

python3 -m pip install --upgrade google-cloud-workloadmanager
from google.cloud import workloadmanager_v1

project_id = "PROJECT_ID"
location = "LOCATION"
parent = f"projects/{project_id}/locations/{location}"

client = workloadmanager_v1.WorkloadManagerClient()

rules = client.list_rules(
    request=workloadmanager_v1.ListRulesRequest(
        parent=parent,
        evaluation_type=workloadmanager_v1.Evaluation.EvaluationType.OTHER,
    )
)

for rule in rules.rules:
    print(rule.name, rule.display_name, rule.severity)

Reference Directory

  • Core Concepts: Evaluations, rules, results, scanned resources, supported workload types, and API shape.

  • General Best Practices: Google Cloud general best-practice posture checks, OTHER evaluation guidance, custom Rego rules, and scale/automation patterns.

  • Client Libraries: Python and Go client library examples for listing rules, creating evaluations, running evaluations, and reading findings.

  • REST Usage: Direct REST examples for the public Workload Manager API and operations polling.

  • Public CLI Status: No documented service-specific gcloud workload-manager command group; use gcloud only for auth, IAM, API enablement, and REST tokens.

  • Public MCP Status: No documented public Workload Manager MCP server; use client libraries or REST API instead.

  • Setup Prerequisites: Terraform examples only for adjacent prerequisites such as API enablement, IAM, BigQuery export datasets, and KMS keys. This is not Workload Manager resource management.

  • IAM & Security: Workload Manager roles, least-privilege guidance, service agents, data handling, and CMEK notes.

If product behavior or API fields are not covered here, check the current Workload Manager product documentation and client library reference before implementing.

Authoritative References

Additional Context

Version History

  • aabe37a Current 2026-07-05 15:30

Same Skill Collection

skills/ads/data-manager-api/data-manager-api-audience-ingestion/SKILL.md
skills/ads/data-manager-api/data-manager-api-event-ingestion/SKILL.md
skills/ads/data-manager-api/data-manager-api-setup/SKILL.md
skills/ads/google-ads-api/google-ads-api-mcp-setup/SKILL.md
skills/ads/google-mobile-ads/google-mobile-ads-android-migrate-to-next-gen/SKILL.md
skills/ads/google-mobile-ads/google-mobile-ads-banner/SKILL.md
skills/ads/google-mobile-ads/google-mobile-ads-get-started/SKILL.md
skills/ads/google-mobile-ads/google-mobile-ads-interstitial/SKILL.md
skills/ads/google-mobile-ads/google-mobile-ads-rewarded/SKILL.md
skills/ads/interactive-media-ads/ima-sdk-basics/SKILL.md
skills/analytics/google-analytics-admin-api-basics/SKILL.md
skills/analytics/google-analytics-data-api-basics/SKILL.md
skills/cloud/agent-platform-endpoint-management/SKILL.md
skills/cloud/agent-platform-migrate-from-ai-studio/SKILL.md
skills/cloud/agent-platform-model-registry/SKILL.md
skills/cloud/agent-platform-prompt-management/SKILL.md
skills/cloud/agent-platform-rag-engine-management/SKILL.md
skills/cloud/agent-platform-skill-registry/SKILL.md
skills/cloud/agent-platform-tuning-management/SKILL.md
skills/cloud/agent-platform-tuning/SKILL.md
skills/cloud/alloydb-basics/SKILL.md
skills/cloud/bigquery-ai-ml/SKILL.md
skills/cloud/bigquery-basics/SKILL.md
skills/cloud/bigquery-bigframes/SKILL.md
skills/cloud/bigtable-basics/SKILL.md
skills/cloud/cloud-run-basics/SKILL.md
skills/cloud/detection-engineering-coverage-evaluation/SKILL.md
skills/cloud/firebase-basics/SKILL.md
skills/cloud/gcloud/SKILL.md
skills/cloud/gemini-agents-api/SKILL.md
skills/cloud/gemini-api/SKILL.md
skills/cloud/gemini-interactions-api/SKILL.md
skills/cloud/gke-app-onboarding/SKILL.md
skills/cloud/gke-backup-dr/SKILL.md
skills/cloud/gke-basics/SKILL.md
skills/cloud/gke-batch-hpc/SKILL.md
skills/cloud/gke-cluster-creation/SKILL.md
skills/cloud/gke-compute-classes/SKILL.md
skills/cloud/gke-cost/SKILL.md
skills/cloud/gke-golden-path/SKILL.md
skills/cloud/gke-inference/SKILL.md
skills/cloud/gke-multitenancy/SKILL.md
skills/cloud/gke-networking/SKILL.md
skills/cloud/gke-observability/SKILL.md
skills/cloud/gke-reliability/SKILL.md
skills/cloud/gke-scaling/SKILL.md
skills/cloud/gke-security/SKILL.md
skills/cloud/gke-storage/SKILL.md
skills/cloud/google-cloud-networking-observability/SKILL.md
skills/cloud/google-cloud-recipe-auth/SKILL.md
skills/cloud/google-cloud-recipe-onboarding/SKILL.md
skills/cloud/google-cloud-waf-cost-optimization/SKILL.md
skills/cloud/google-cloud-waf-operational-excellence/SKILL.md
skills/cloud/google-cloud-waf-performance-optimization/SKILL.md
skills/cloud/google-cloud-waf-reliability/SKILL.md
skills/cloud/google-cloud-waf-security/SKILL.md
skills/cloud/google-cloud-waf-sustainability/SKILL.md
skills/cloud/iam-recommendations-fetcher/SKILL.md
skills/ads/google-ads-api/google-ads-api-quickstart/SKILL.md
skills/cloud/agent-platform-alert-configuration/SKILL.md
skills/cloud/agent-platform-deploy/SKILL.md
skills/cloud/agent-platform-eval-flywheel/SKILL.md
skills/cloud/agent-platform-inference/SKILL.md
skills/cloud/cloud-sql-basics/SKILL.md
skills/cloud/datalineage-bigquery-asset-impact-analysis/SKILL.md
skills/cloud/gke-upgrades/SKILL.md
skills/cloud/google-agents-cli-onboarding/SKILL.md
skills/cloud/google-cloud-recipe-foundation-builder/SKILL.md

Metadata

Files
0
Version
aabe37a
Hash
81312f7c
Indexed
2026-07-05 15:30

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-09 13:29
浙ICP备14020137号-1 $Гость$