From 7001d0ad18a888068a3e9a212c142ec765bd894a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 17:20:40 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.63.2 (#165) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 431037888 Source-Link: https://github.com/googleapis/googleapis/commit/b3397f5febbf21dfc69b875ddabaf76bee765058 Source-Link: https://github.com/googleapis/googleapis-gen/commit/510b54e1cdefd53173984df16645081308fe897e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTEwYjU0ZTFjZGVmZDUzMTczOTg0ZGYxNjY0NTA4MTMwOGZlODk3ZSJ9 feat: Add item that is affected by vulnerability feat: Add GetOsPolicyAssignmentReport and analogous List rpc method feat: Add Inventory to InstanceFilter feat: Add existing os_policy_assignment_reports.proto fix: Mark methods as deprecated docs: add generated snippets PiperOrigin-RevId: 430730865 Source-Link: https://github.com/googleapis/googleapis/commit/ea5800229f73f94fd7204915a86ed09dcddf429a Source-Link: https://github.com/googleapis/googleapis-gen/commit/ca893ff8af25fc7fe001de1405a517d80446ecca Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2E4OTNmZjhhZjI1ZmM3ZmUwMDFkZTE0MDVhNTE3ZDgwNDQ2ZWNjYSJ9 PiperOrigin-RevId: 427792504 Source-Link: https://github.com/googleapis/googleapis/commit/55b9e1e0b3106c850d13958352bc0751147b6b15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 --- .../google/cloud/osconfig/__init__.py | 2 +- .../google/cloud/osconfig_v1/__init__.py | 2 +- .../cloud/osconfig_v1/services/__init__.py | 2 +- .../services/os_config_service/__init__.py | 2 +- .../os_config_service/async_client.py | 50 +- .../services/os_config_service/client.py | 62 +- .../services/os_config_service/pagers.py | 2 +- .../os_config_service/transports/__init__.py | 2 +- .../os_config_service/transports/base.py | 2 +- .../os_config_service/transports/grpc.py | 2 +- .../transports/grpc_asyncio.py | 2 +- .../os_config_zonal_service/__init__.py | 2 +- .../os_config_zonal_service/async_client.py | 50 +- .../os_config_zonal_service/client.py | 62 +- .../os_config_zonal_service/pagers.py | 2 +- .../transports/__init__.py | 2 +- .../transports/base.py | 2 +- .../transports/grpc.py | 2 +- .../transports/grpc_asyncio.py | 2 +- .../cloud/osconfig_v1/types/__init__.py | 2 +- .../cloud/osconfig_v1/types/inventory.py | 2 +- .../cloud/osconfig_v1/types/os_policy.py | 2 +- .../types/os_policy_assignment_reports.py | 2 +- .../types/os_policy_assignments.py | 2 +- .../osconfig_v1/types/osconfig_common.py | 2 +- .../osconfig_v1/types/osconfig_service.py | 2 +- .../types/osconfig_zonal_service.py | 2 +- .../osconfig_v1/types/patch_deployments.py | 2 +- .../cloud/osconfig_v1/types/patch_jobs.py | 2 +- .../cloud/osconfig_v1/types/vulnerability.py | 2 +- .../google/cloud/osconfig_v1alpha/__init__.py | 10 +- .../osconfig_v1alpha/gapic_metadata.json | 20 + .../osconfig_v1alpha/services/__init__.py | 2 +- .../os_config_zonal_service/__init__.py | 2 +- .../os_config_zonal_service/async_client.py | 323 ++++++- .../os_config_zonal_service/client.py | 373 +++++++- .../os_config_zonal_service/pagers.py | 152 +++- .../transports/__init__.py | 2 +- .../transports/base.py | 39 +- .../transports/grpc.py | 69 +- .../transports/grpc_asyncio.py | 69 +- .../cloud/osconfig_v1alpha/types/__init__.py | 12 +- .../osconfig_v1alpha/types/config_common.py | 5 +- .../types/instance_os_policies_compliance.py | 2 +- .../cloud/osconfig_v1alpha/types/inventory.py | 18 +- .../cloud/osconfig_v1alpha/types/os_policy.py | 47 +- .../types/os_policy_assignment_reports.py | 329 +++++++ .../types/os_policy_assignments.py | 52 +- .../osconfig_v1alpha/types/osconfig_common.py | 2 +- .../types/osconfig_zonal_service.py | 2 +- .../osconfig_v1alpha/types/vulnerability.py | 50 +- ...s_config_service_cancel_patch_job_async.py | 2 +- ...os_config_service_cancel_patch_job_sync.py | 2 +- ...g_service_create_patch_deployment_async.py | 2 +- ...ig_service_create_patch_deployment_sync.py | 2 +- ...g_service_delete_patch_deployment_async.py | 2 +- ...ig_service_delete_patch_deployment_sync.py | 2 +- ..._config_service_execute_patch_job_async.py | 2 +- ...s_config_service_execute_patch_job_sync.py | 2 +- ...nfig_service_get_patch_deployment_async.py | 2 +- ...onfig_service_get_patch_deployment_sync.py | 2 +- ...1_os_config_service_get_patch_job_async.py | 2 +- ...v1_os_config_service_get_patch_job_sync.py | 2 +- ...ig_service_list_patch_deployments_async.py | 2 + ...fig_service_list_patch_deployments_sync.py | 2 + ...e_list_patch_job_instance_details_async.py | 2 + ...ce_list_patch_job_instance_details_sync.py | 2 + ...os_config_service_list_patch_jobs_async.py | 2 + ..._os_config_service_list_patch_jobs_sync.py | 2 + ...ig_service_pause_patch_deployment_async.py | 2 +- ...fig_service_pause_patch_deployment_sync.py | 2 +- ...g_service_resume_patch_deployment_async.py | 2 +- ...ig_service_resume_patch_deployment_sync.py | 2 +- ...g_service_update_patch_deployment_async.py | 2 +- ...ig_service_update_patch_deployment_sync.py | 2 +- ...rvice_create_os_policy_assignment_async.py | 2 + ...ervice_create_os_policy_assignment_sync.py | 2 + ...rvice_delete_os_policy_assignment_async.py | 2 + ...ervice_delete_os_policy_assignment_sync.py | 2 + ...onfig_zonal_service_get_inventory_async.py | 2 +- ...config_zonal_service_get_inventory_sync.py | 2 +- ..._service_get_os_policy_assignment_async.py | 2 +- ...e_get_os_policy_assignment_report_async.py | 2 +- ...ce_get_os_policy_assignment_report_sync.py | 2 +- ...l_service_get_os_policy_assignment_sync.py | 2 +- ..._service_get_vulnerability_report_async.py | 2 +- ...l_service_get_vulnerability_report_sync.py | 2 +- ...ig_zonal_service_list_inventories_async.py | 2 + ...fig_zonal_service_list_inventories_sync.py | 2 + ...list_os_policy_assignment_reports_async.py | 2 + ..._list_os_policy_assignment_reports_sync.py | 2 + ...st_os_policy_assignment_revisions_async.py | 2 + ...ist_os_policy_assignment_revisions_sync.py | 2 + ...ervice_list_os_policy_assignments_async.py | 2 + ...service_list_os_policy_assignments_sync.py | 2 + ...ervice_list_vulnerability_reports_async.py | 2 + ...service_list_vulnerability_reports_sync.py | 2 + ...rvice_update_os_policy_assignment_async.py | 2 + ...ervice_update_os_policy_assignment_sync.py | 2 + ...rvice_create_os_policy_assignment_async.py | 2 + ...ervice_create_os_policy_assignment_sync.py | 2 + ...rvice_delete_os_policy_assignment_async.py | 2 + ...ervice_delete_os_policy_assignment_sync.py | 2 + ...t_instance_os_policies_compliance_async.py | 2 +- ...et_instance_os_policies_compliance_sync.py | 2 +- ...onfig_zonal_service_get_inventory_async.py | 2 +- ...config_zonal_service_get_inventory_sync.py | 2 +- ..._service_get_os_policy_assignment_async.py | 2 +- ...e_get_os_policy_assignment_report_async.py | 45 + ...ce_get_os_policy_assignment_report_sync.py | 45 + ...l_service_get_os_policy_assignment_sync.py | 2 +- ..._service_get_vulnerability_report_async.py | 2 +- ...l_service_get_vulnerability_report_sync.py | 2 +- ..._instance_os_policies_compliances_async.py | 2 + ...t_instance_os_policies_compliances_sync.py | 2 + ...ig_zonal_service_list_inventories_async.py | 2 + ...fig_zonal_service_list_inventories_sync.py | 2 + ...list_os_policy_assignment_reports_async.py | 46 + ..._list_os_policy_assignment_reports_sync.py | 46 + ...st_os_policy_assignment_revisions_async.py | 2 + ...ist_os_policy_assignment_revisions_sync.py | 2 + ...ervice_list_os_policy_assignments_async.py | 2 + ...service_list_os_policy_assignments_sync.py | 2 + ...ervice_list_vulnerability_reports_async.py | 2 + ...service_list_vulnerability_reports_sync.py | 2 + ...rvice_update_os_policy_assignment_async.py | 2 + ...ervice_update_os_policy_assignment_sync.py | 2 + ...s_config_service_cancel_patch_job_async.py | 45 + ...os_config_service_cancel_patch_job_sync.py | 45 + ...g_service_create_patch_deployment_async.py | 46 + ...ig_service_create_patch_deployment_sync.py | 46 + ...g_service_delete_patch_deployment_async.py | 43 + ...ig_service_delete_patch_deployment_sync.py | 43 + ..._config_service_execute_patch_job_async.py | 45 + ...s_config_service_execute_patch_job_sync.py | 45 + ...nfig_service_get_patch_deployment_async.py | 45 + ...onfig_service_get_patch_deployment_sync.py | 45 + ...d_os_config_service_get_patch_job_async.py | 45 + ...ed_os_config_service_get_patch_job_sync.py | 45 + ...ig_service_list_patch_deployments_async.py | 46 + ...fig_service_list_patch_deployments_sync.py | 46 + ...e_list_patch_job_instance_details_async.py | 46 + ...ce_list_patch_job_instance_details_sync.py | 46 + ...os_config_service_list_patch_jobs_async.py | 46 + ..._os_config_service_list_patch_jobs_sync.py | 46 + ...ig_service_pause_patch_deployment_async.py | 45 + ...fig_service_pause_patch_deployment_sync.py | 45 + ...g_service_resume_patch_deployment_async.py | 45 + ...ig_service_resume_patch_deployment_sync.py | 45 + ...g_service_update_patch_deployment_async.py | 44 + ...ig_service_update_patch_deployment_sync.py | 44 + ...rvice_create_os_policy_assignment_async.py | 59 ++ ...ervice_create_os_policy_assignment_sync.py | 59 ++ ...rvice_delete_os_policy_assignment_async.py | 49 ++ ...ervice_delete_os_policy_assignment_sync.py | 49 ++ ...onfig_zonal_service_get_inventory_async.py | 45 + ...config_zonal_service_get_inventory_sync.py | 45 + ..._service_get_os_policy_assignment_async.py | 45 + ...e_get_os_policy_assignment_report_async.py | 45 + ...ce_get_os_policy_assignment_report_sync.py | 45 + ...l_service_get_os_policy_assignment_sync.py | 45 + ..._service_get_vulnerability_report_async.py | 45 + ...l_service_get_vulnerability_report_sync.py | 45 + ...ig_zonal_service_list_inventories_async.py | 46 + ...fig_zonal_service_list_inventories_sync.py | 46 + ...list_os_policy_assignment_reports_async.py | 46 + ..._list_os_policy_assignment_reports_sync.py | 46 + ...st_os_policy_assignment_revisions_async.py | 46 + ...ist_os_policy_assignment_revisions_sync.py | 46 + ...ervice_list_os_policy_assignments_async.py | 46 + ...service_list_os_policy_assignments_sync.py | 46 + ...ervice_list_vulnerability_reports_async.py | 46 + ...service_list_vulnerability_reports_sync.py | 46 + ...rvice_update_os_policy_assignment_async.py | 57 ++ ...ervice_update_os_policy_assignment_sync.py | 57 ++ ...rvice_create_os_policy_assignment_async.py | 59 ++ ...ervice_create_os_policy_assignment_sync.py | 59 ++ ...rvice_delete_os_policy_assignment_async.py | 49 ++ ...ervice_delete_os_policy_assignment_sync.py | 49 ++ ...t_instance_os_policies_compliance_async.py | 45 + ...et_instance_os_policies_compliance_sync.py | 45 + ...onfig_zonal_service_get_inventory_async.py | 45 + ...config_zonal_service_get_inventory_sync.py | 45 + ..._service_get_os_policy_assignment_async.py | 45 + ...e_get_os_policy_assignment_report_async.py | 45 + ...ce_get_os_policy_assignment_report_sync.py | 45 + ...l_service_get_os_policy_assignment_sync.py | 45 + ..._service_get_vulnerability_report_async.py | 45 + ...l_service_get_vulnerability_report_sync.py | 45 + ..._instance_os_policies_compliances_async.py | 46 + ...t_instance_os_policies_compliances_sync.py | 46 + ...ig_zonal_service_list_inventories_async.py | 46 + ...fig_zonal_service_list_inventories_sync.py | 46 + ...list_os_policy_assignment_reports_async.py | 46 + ..._list_os_policy_assignment_reports_sync.py | 46 + ...st_os_policy_assignment_revisions_async.py | 46 + ...ist_os_policy_assignment_revisions_sync.py | 46 + ...ervice_list_os_policy_assignments_async.py | 46 + ...service_list_os_policy_assignments_sync.py | 46 + ...ervice_list_vulnerability_reports_async.py | 46 + ...service_list_vulnerability_reports_sync.py | 46 + ...rvice_update_os_policy_assignment_async.py | 57 ++ ...ervice_update_os_policy_assignment_sync.py | 57 ++ .../snippet_metadata_osconfig_v1.json | 368 ++++---- .../snippet_metadata_osconfig_v1alpha.json | 402 ++++++--- .../scripts/fixup_osconfig_v1_keywords.py | 2 +- .../fixup_osconfig_v1alpha_keywords.py | 4 +- packages/google-cloud-os-config/setup.py | 2 +- .../testing/constraints-3.6.txt | 2 +- .../google-cloud-os-config/tests/__init__.py | 2 +- .../tests/unit/__init__.py | 2 +- .../tests/unit/gapic/__init__.py | 2 +- .../tests/unit/gapic/osconfig_v1/__init__.py | 2 +- .../osconfig_v1/test_os_config_service.py | 2 +- .../test_os_config_zonal_service.py | 2 +- .../unit/gapic/osconfig_v1alpha/__init__.py | 2 +- .../test_os_config_zonal_service.py | 812 +++++++++++++++++- 217 files changed, 6785 insertions(+), 567 deletions(-) create mode 100644 packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy_assignment_reports.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_report_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_report_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_reports_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_reports_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_cancel_patch_job_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_cancel_patch_job_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_create_patch_deployment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_create_patch_deployment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_delete_patch_deployment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_delete_patch_deployment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_execute_patch_job_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_execute_patch_job_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_deployment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_deployment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_job_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_job_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_deployments_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_deployments_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_job_instance_details_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_job_instance_details_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_jobs_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_jobs_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_pause_patch_deployment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_pause_patch_deployment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_resume_patch_deployment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_resume_patch_deployment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_update_patch_deployment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_update_patch_deployment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_inventory_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_inventory_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_inventories_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_inventories_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_sync.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.py create mode 100644 packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_sync.py diff --git a/packages/google-cloud-os-config/google/cloud/osconfig/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig/__init__.py index 1b9f70328c84..00a8c41f482d 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/__init__.py index 4165131ccbc9..c6dab2140129 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/__init__.py index 3610b9bc5af8..927d149e12a1 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/async_client.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/async_client.py index dec7c904f0d1..5c14beac66e9 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/async_client.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -228,7 +228,7 @@ async def execute_patch_job( job. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -244,7 +244,7 @@ def sample_execute_patch_job(): # Make the request response = client.execute_patch_job(request=request) - # Handle response + # Handle the response print(response) Args: @@ -308,7 +308,7 @@ async def get_patch_job( of completed jobs. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -324,7 +324,7 @@ def sample_get_patch_job(): # Make the request response = client.get_patch_job(request=request) - # Handle response + # Handle the response print(response) Args: @@ -407,7 +407,7 @@ async def cancel_patch_job( Canceled patch jobs cannot be restarted. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -423,7 +423,7 @@ def sample_cancel_patch_job(): # Make the request response = client.cancel_patch_job(request=request) - # Handle response + # Handle the response print(response) Args: @@ -483,7 +483,7 @@ async def list_patch_jobs( ) -> pagers.ListPatchJobsAsyncPager: r"""Get a list of patch jobs. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -498,6 +498,8 @@ def sample_list_patch_jobs(): # Make the request page_result = client.list_patch_jobs(request=request) + + # Handle the response for response in page_result: print(response) @@ -579,7 +581,7 @@ async def list_patch_job_instance_details( ) -> pagers.ListPatchJobInstanceDetailsAsyncPager: r"""Get a list of instance details for a given patch job. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -594,6 +596,8 @@ def sample_list_patch_job_instance_details(): # Make the request page_result = client.list_patch_job_instance_details(request=request) + + # Handle the response for response in page_result: print(response) @@ -679,7 +683,7 @@ async def create_patch_deployment( ) -> patch_deployments.PatchDeployment: r"""Create an OS Config patch deployment. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -696,7 +700,7 @@ def sample_create_patch_deployment(): # Make the request response = client.create_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -799,7 +803,7 @@ async def get_patch_deployment( ) -> patch_deployments.PatchDeployment: r"""Get an OS Config patch deployment. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -815,7 +819,7 @@ def sample_get_patch_deployment(): # Make the request response = client.get_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -893,7 +897,7 @@ async def list_patch_deployments( ) -> pagers.ListPatchDeploymentsAsyncPager: r"""Get a page of OS Config patch deployments. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -908,6 +912,8 @@ def sample_list_patch_deployments(): # Make the request page_result = client.list_patch_deployments(request=request) + + # Handle the response for response in page_result: print(response) @@ -991,7 +997,7 @@ async def delete_patch_deployment( ) -> None: r"""Delete an OS Config patch deployment. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1005,7 +1011,7 @@ def sample_delete_patch_deployment(): ) # Make the request - response = client.delete_patch_deployment(request=request) + client.delete_patch_deployment(request=request) Args: request (Union[google.cloud.osconfig_v1.types.DeletePatchDeploymentRequest, dict]): @@ -1072,7 +1078,7 @@ async def update_patch_deployment( ) -> patch_deployments.PatchDeployment: r"""Update an OS Config patch deployment. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1087,7 +1093,7 @@ def sample_update_patch_deployment(): # Make the request response = client.update_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1180,7 +1186,7 @@ async def pause_patch_deployment( jobs. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1196,7 +1202,7 @@ def sample_pause_patch_deployment(): # Make the request response = client.pause_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1277,7 +1283,7 @@ async def resume_patch_deployment( patch jobs. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1293,7 +1299,7 @@ def sample_resume_patch_deployment(): # Make the request response = client.resume_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/client.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/client.py index 8078c1f32457..62422dce320f 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/client.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -448,8 +448,7 @@ def execute_patch_job( job. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -465,7 +464,7 @@ def sample_execute_patch_job(): # Make the request response = client.execute_patch_job(request=request) - # Handle response + # Handle the response print(response) Args: @@ -530,8 +529,7 @@ def get_patch_job( of completed jobs. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -547,7 +545,7 @@ def sample_get_patch_job(): # Make the request response = client.get_patch_job(request=request) - # Handle response + # Handle the response print(response) Args: @@ -630,8 +628,7 @@ def cancel_patch_job( Canceled patch jobs cannot be restarted. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -647,7 +644,7 @@ def sample_cancel_patch_job(): # Make the request response = client.cancel_patch_job(request=request) - # Handle response + # Handle the response print(response) Args: @@ -708,8 +705,7 @@ def list_patch_jobs( ) -> pagers.ListPatchJobsPager: r"""Get a list of patch jobs. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -724,6 +720,8 @@ def sample_list_patch_jobs(): # Make the request page_result = client.list_patch_jobs(request=request) + + # Handle the response for response in page_result: print(response) @@ -805,8 +803,7 @@ def list_patch_job_instance_details( ) -> pagers.ListPatchJobInstanceDetailsPager: r"""Get a list of instance details for a given patch job. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -821,6 +818,8 @@ def sample_list_patch_job_instance_details(): # Make the request page_result = client.list_patch_job_instance_details(request=request) + + # Handle the response for response in page_result: print(response) @@ -908,8 +907,7 @@ def create_patch_deployment( ) -> patch_deployments.PatchDeployment: r"""Create an OS Config patch deployment. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -926,7 +924,7 @@ def sample_create_patch_deployment(): # Make the request response = client.create_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1029,8 +1027,7 @@ def get_patch_deployment( ) -> patch_deployments.PatchDeployment: r"""Get an OS Config patch deployment. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1046,7 +1043,7 @@ def sample_get_patch_deployment(): # Make the request response = client.get_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1124,8 +1121,7 @@ def list_patch_deployments( ) -> pagers.ListPatchDeploymentsPager: r"""Get a page of OS Config patch deployments. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1140,6 +1136,8 @@ def sample_list_patch_deployments(): # Make the request page_result = client.list_patch_deployments(request=request) + + # Handle the response for response in page_result: print(response) @@ -1223,8 +1221,7 @@ def delete_patch_deployment( ) -> None: r"""Delete an OS Config patch deployment. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1238,7 +1235,7 @@ def sample_delete_patch_deployment(): ) # Make the request - response = client.delete_patch_deployment(request=request) + client.delete_patch_deployment(request=request) Args: request (Union[google.cloud.osconfig_v1.types.DeletePatchDeploymentRequest, dict]): @@ -1305,8 +1302,7 @@ def update_patch_deployment( ) -> patch_deployments.PatchDeployment: r"""Update an OS Config patch deployment. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1321,7 +1317,7 @@ def sample_update_patch_deployment(): # Make the request response = client.update_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1414,8 +1410,7 @@ def pause_patch_deployment( jobs. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1431,7 +1426,7 @@ def sample_pause_patch_deployment(): # Make the request response = client.pause_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1512,8 +1507,7 @@ def resume_patch_deployment( patch jobs. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1529,7 +1523,7 @@ def sample_resume_patch_deployment(): # Make the request response = client.resume_patch_deployment(request=request) - # Handle response + # Handle the response print(response) Args: diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/pagers.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/pagers.py index 67df93fd74a9..0a1b71b0bbe1 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/pagers.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/__init__.py index 81f5e75901d2..32db8031381f 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/base.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/base.py index 8f227c2c2ac4..45ed97888b32 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/base.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/grpc.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/grpc.py index c76859cf642d..efed4afa73d6 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/grpc.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/grpc_asyncio.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/grpc_asyncio.py index bb65e3b8f2fd..eadab2c5fb76 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/__init__.py index 0948ebea2db7..b9c77c225515 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/async_client.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/async_client.py index 17b888f71dd8..94e9cbaff45d 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/async_client.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -268,7 +268,7 @@ async def create_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -297,6 +297,8 @@ def sample_create_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -431,7 +433,7 @@ async def update_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -458,6 +460,8 @@ def sample_update_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -568,7 +572,7 @@ async def get_os_policy_assignment( revision ID in the ``name`` parameter. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -584,7 +588,7 @@ def sample_get_os_policy_assignment(): # Make the request response = client.get_os_policy_assignment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -676,7 +680,7 @@ async def list_os_policy_assignments( returned. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -691,6 +695,8 @@ def sample_list_os_policy_assignments(): # Make the request page_result = client.list_os_policy_assignments(request=request) + + # Handle the response for response in page_result: print(response) @@ -776,7 +782,7 @@ async def list_os_policy_assignment_revisions( OS policy assignment. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -791,6 +797,8 @@ def sample_list_os_policy_assignment_revisions(): # Make the request page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response for response in page_result: print(response) @@ -889,7 +897,7 @@ async def delete_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -908,6 +916,8 @@ def sample_delete_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -1006,7 +1016,7 @@ async def get_os_policy_assignment_report( specified Compute Engine VM instance. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1022,7 +1032,7 @@ def sample_get_os_policy_assignment_report(): # Make the request response = client.get_os_policy_assignment_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1112,7 +1122,7 @@ async def list_os_policy_assignment_reports( Engine VM instances in the specified zone. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1127,6 +1137,8 @@ def sample_list_os_policy_assignment_reports(): # Make the request page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response for response in page_result: print(response) @@ -1239,7 +1251,7 @@ async def get_inventory( no associated inventory, the message ``NOT_FOUND`` is returned. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1255,7 +1267,7 @@ def sample_get_inventory(): # Make the request response = client.get_inventory(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1346,7 +1358,7 @@ async def list_inventories( specified zone. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1361,6 +1373,8 @@ def sample_list_inventories(): # Make the request page_result = client.list_inventories(request=request) + + # Handle the response for response in page_result: print(response) @@ -1453,7 +1467,7 @@ async def get_vulnerability_report( vulnerability reports associated with them. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1469,7 +1483,7 @@ def sample_get_vulnerability_report(): # Make the request response = client.get_vulnerability_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1556,7 +1570,7 @@ async def list_vulnerability_reports( the specified zone. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1571,6 +1585,8 @@ def sample_list_vulnerability_reports(): # Make the request page_result = client.list_vulnerability_reports(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/client.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/client.py index af4aed3bec3d..5ba0bc1e9c27 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/client.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -534,8 +534,7 @@ def create_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -564,6 +563,8 @@ def sample_create_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -702,8 +703,7 @@ def update_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -730,6 +730,8 @@ def sample_update_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -844,8 +846,7 @@ def get_os_policy_assignment( revision ID in the ``name`` parameter. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -861,7 +862,7 @@ def sample_get_os_policy_assignment(): # Make the request response = client.get_os_policy_assignment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -953,8 +954,7 @@ def list_os_policy_assignments( returned. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -969,6 +969,8 @@ def sample_list_os_policy_assignments(): # Make the request page_result = client.list_os_policy_assignments(request=request) + + # Handle the response for response in page_result: print(response) @@ -1058,8 +1060,7 @@ def list_os_policy_assignment_revisions( OS policy assignment. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1074,6 +1075,8 @@ def sample_list_os_policy_assignment_revisions(): # Make the request page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response for response in page_result: print(response) @@ -1178,8 +1181,7 @@ def delete_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1198,6 +1200,8 @@ def sample_delete_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -1300,8 +1304,7 @@ def get_os_policy_assignment_report( specified Compute Engine VM instance. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1317,7 +1320,7 @@ def sample_get_os_policy_assignment_report(): # Make the request response = client.get_os_policy_assignment_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1411,8 +1414,7 @@ def list_os_policy_assignment_reports( Engine VM instances in the specified zone. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1427,6 +1429,8 @@ def sample_list_os_policy_assignment_reports(): # Make the request page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response for response in page_result: print(response) @@ -1543,8 +1547,7 @@ def get_inventory( no associated inventory, the message ``NOT_FOUND`` is returned. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1560,7 +1563,7 @@ def sample_get_inventory(): # Make the request response = client.get_inventory(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1651,8 +1654,7 @@ def list_inventories( specified zone. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1667,6 +1669,8 @@ def sample_list_inventories(): # Make the request page_result = client.list_inventories(request=request) + + # Handle the response for response in page_result: print(response) @@ -1759,8 +1763,7 @@ def get_vulnerability_report( vulnerability reports associated with them. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1776,7 +1779,7 @@ def sample_get_vulnerability_report(): # Make the request response = client.get_vulnerability_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1863,8 +1866,7 @@ def list_vulnerability_reports( the specified zone. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1 @@ -1879,6 +1881,8 @@ def sample_list_vulnerability_reports(): # Make the request page_result = client.list_vulnerability_reports(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/pagers.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/pagers.py index 1f136c79d973..405e247a082b 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/pagers.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/__init__.py index c070e43930b9..5328c9db4d90 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/base.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/base.py index 0fde8d68c1a0..a3ba778ddd07 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/base.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/grpc.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/grpc.py index 8b4cd2599a23..2d02a3414be8 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/grpc.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/grpc_asyncio.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/grpc_asyncio.py index ec99a7992723..71a84ee62c83 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/services/os_config_zonal_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/__init__.py index a1749dcb5a8f..5cc68613c523 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/inventory.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/inventory.py index 27bb4abd9353..4b8268a5cd56 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/inventory.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/inventory.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy.py index 34885e8a9c1c..5b753a7ba687 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy_assignment_reports.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy_assignment_reports.py index 29b4d2296429..de82489fccc9 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy_assignment_reports.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy_assignment_reports.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy_assignments.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy_assignments.py index e19c445d008f..40bb5b2e58dc 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy_assignments.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/os_policy_assignments.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_common.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_common.py index 5bf5e840a723..7806de070f35 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_common.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_common.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_service.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_service.py index 5a02c6a217ab..93be0a1655a5 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_service.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_zonal_service.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_zonal_service.py index 5a02c6a217ab..93be0a1655a5 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_zonal_service.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/osconfig_zonal_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/patch_deployments.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/patch_deployments.py index 6c59f5fb6738..7ef6a04b95cd 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/patch_deployments.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/patch_deployments.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/patch_jobs.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/patch_jobs.py index 67cc49b1d3c5..bb7133fe4e5b 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/patch_jobs.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/patch_jobs.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/vulnerability.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/vulnerability.py index aae01c8d2f9d..af2bbeb8d084 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/vulnerability.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1/types/vulnerability.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/__init__.py index a51d1bff158d..dd90f0b93e2d 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,6 +36,10 @@ from .types.inventory import ListInventoriesResponse from .types.inventory import InventoryView from .types.os_policy import OSPolicy +from .types.os_policy_assignment_reports import GetOSPolicyAssignmentReportRequest +from .types.os_policy_assignment_reports import ListOSPolicyAssignmentReportsRequest +from .types.os_policy_assignment_reports import ListOSPolicyAssignmentReportsResponse +from .types.os_policy_assignment_reports import OSPolicyAssignmentReport from .types.os_policy_assignments import CreateOSPolicyAssignmentRequest from .types.os_policy_assignments import DeleteOSPolicyAssignmentRequest from .types.os_policy_assignments import GetOSPolicyAssignmentRequest @@ -61,6 +65,7 @@ "FixedOrPercent", "GetInstanceOSPoliciesComplianceRequest", "GetInventoryRequest", + "GetOSPolicyAssignmentReportRequest", "GetOSPolicyAssignmentRequest", "GetVulnerabilityReportRequest", "InstanceOSPoliciesCompliance", @@ -70,6 +75,8 @@ "ListInstanceOSPoliciesCompliancesResponse", "ListInventoriesRequest", "ListInventoriesResponse", + "ListOSPolicyAssignmentReportsRequest", + "ListOSPolicyAssignmentReportsResponse", "ListOSPolicyAssignmentRevisionsRequest", "ListOSPolicyAssignmentRevisionsResponse", "ListOSPolicyAssignmentsRequest", @@ -79,6 +86,7 @@ "OSPolicy", "OSPolicyAssignment", "OSPolicyAssignmentOperationMetadata", + "OSPolicyAssignmentReport", "OSPolicyComplianceState", "OSPolicyResourceCompliance", "OSPolicyResourceConfigStep", diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/gapic_metadata.json b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/gapic_metadata.json index 74295757cc48..ac50f4b2da83 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/gapic_metadata.json +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/gapic_metadata.json @@ -35,6 +35,11 @@ "get_os_policy_assignment" ] }, + "GetOSPolicyAssignmentReport": { + "methods": [ + "get_os_policy_assignment_report" + ] + }, "GetVulnerabilityReport": { "methods": [ "get_vulnerability_report" @@ -50,6 +55,11 @@ "list_inventories" ] }, + "ListOSPolicyAssignmentReports": { + "methods": [ + "list_os_policy_assignment_reports" + ] + }, "ListOSPolicyAssignmentRevisions": { "methods": [ "list_os_policy_assignment_revisions" @@ -100,6 +110,11 @@ "get_os_policy_assignment" ] }, + "GetOSPolicyAssignmentReport": { + "methods": [ + "get_os_policy_assignment_report" + ] + }, "GetVulnerabilityReport": { "methods": [ "get_vulnerability_report" @@ -115,6 +130,11 @@ "list_inventories" ] }, + "ListOSPolicyAssignmentReports": { + "methods": [ + "list_os_policy_assignment_reports" + ] + }, "ListOSPolicyAssignmentRevisions": { "methods": [ "list_os_policy_assignment_revisions" diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/__init__.py index 0948ebea2db7..b9c77c225515 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/async_client.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/async_client.py index f23197ae445a..fee9d8782cf5 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/async_client.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ import re from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources +import warnings from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -38,6 +39,7 @@ from google.cloud.osconfig_v1alpha.types import instance_os_policies_compliance from google.cloud.osconfig_v1alpha.types import inventory from google.cloud.osconfig_v1alpha.types import os_policy +from google.cloud.osconfig_v1alpha.types import os_policy_assignment_reports from google.cloud.osconfig_v1alpha.types import os_policy_assignments from google.cloud.osconfig_v1alpha.types import vulnerability from google.protobuf import empty_pb2 # type: ignore @@ -68,6 +70,12 @@ class OsConfigZonalServiceAsyncClient: parse_instance_os_policies_compliance_path = staticmethod( OsConfigZonalServiceClient.parse_instance_os_policies_compliance_path ) + instance_os_policy_assignment_path = staticmethod( + OsConfigZonalServiceClient.instance_os_policy_assignment_path + ) + parse_instance_os_policy_assignment_path = staticmethod( + OsConfigZonalServiceClient.parse_instance_os_policy_assignment_path + ) inventory_path = staticmethod(OsConfigZonalServiceClient.inventory_path) parse_inventory_path = staticmethod(OsConfigZonalServiceClient.parse_inventory_path) os_policy_assignment_path = staticmethod( @@ -76,6 +84,12 @@ class OsConfigZonalServiceAsyncClient: parse_os_policy_assignment_path = staticmethod( OsConfigZonalServiceClient.parse_os_policy_assignment_path ) + os_policy_assignment_report_path = staticmethod( + OsConfigZonalServiceClient.os_policy_assignment_report_path + ) + parse_os_policy_assignment_report_path = staticmethod( + OsConfigZonalServiceClient.parse_os_policy_assignment_report_path + ) vulnerability_report_path = staticmethod( OsConfigZonalServiceClient.vulnerability_report_path ) @@ -263,7 +277,7 @@ async def create_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -292,6 +306,8 @@ def sample_create_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -426,7 +442,7 @@ async def update_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -453,6 +469,8 @@ def sample_update_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -563,7 +581,7 @@ async def get_os_policy_assignment( revision ID in the ``name`` parameter. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -579,7 +597,7 @@ def sample_get_os_policy_assignment(): # Make the request response = client.get_os_policy_assignment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -671,7 +689,7 @@ async def list_os_policy_assignments( returned. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -686,6 +704,8 @@ def sample_list_os_policy_assignments(): # Make the request page_result = client.list_os_policy_assignments(request=request) + + # Handle the response for response in page_result: print(response) @@ -771,7 +791,7 @@ async def list_os_policy_assignment_revisions( OS policy assignment. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -786,6 +806,8 @@ def sample_list_os_policy_assignment_revisions(): # Make the request page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response for response in page_result: print(response) @@ -884,7 +906,7 @@ async def delete_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -903,6 +925,8 @@ def sample_delete_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -1001,7 +1025,7 @@ async def get_instance_os_policies_compliance( Compute Engine VM instance. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1017,7 +1041,7 @@ def sample_get_instance_os_policies_compliance(): # Make the request response = client.get_instance_os_policies_compliance(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1065,6 +1089,11 @@ def sample_get_instance_os_policies_compliance(): compliance](\ https://cloud.google.com/compute/docs/os-configuration-management/view-compliance). """ + warnings.warn( + "OsConfigZonalServiceAsyncClient.get_instance_os_policies_compliance is deprecated", + DeprecationWarning, + ) + # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. @@ -1120,7 +1149,7 @@ async def list_instance_os_policies_compliances( Engine VM instances in the specified zone. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1135,6 +1164,8 @@ def sample_list_instance_os_policies_compliances(): # Make the request page_result = client.list_instance_os_policies_compliances(request=request) + + # Handle the response for response in page_result: print(response) @@ -1170,6 +1201,11 @@ def sample_list_instance_os_policies_compliances(): automatically. """ + warnings.warn( + "OsConfigZonalServiceAsyncClient.list_instance_os_policies_compliances is deprecated", + DeprecationWarning, + ) + # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. @@ -1215,6 +1251,243 @@ def sample_list_instance_os_policies_compliances(): # Done; return the response. return response + async def get_os_policy_assignment_report( + self, + request: Union[ + os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest, dict + ] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> os_policy_assignment_reports.OSPolicyAssignmentReport: + r"""Get the OS policy asssignment report for the + specified Compute Engine VM instance. + + + .. code-block:: python + + from google.cloud import osconfig_v1alpha + + def sample_get_os_policy_assignment_report(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetOSPolicyAssignmentReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_os_policy_assignment_report(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.osconfig_v1alpha.types.GetOSPolicyAssignmentReportRequest, dict]): + The request object. Get a report of the OS policy + assignment for a VM instance. + name (:class:`str`): + Required. API resource name for OS policy assignment + report. + + Format: + ``/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report`` + + For ``{project}``, either ``project-number`` or + ``project-id`` can be provided. For ``{instance_id}``, + either Compute Engine ``instance-id`` or + ``instance-name`` can be provided. For + ``{assignment_id}``, the OSPolicyAssignment id must be + provided. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport: + A report of the OS policy assignment + status for a given instance. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest( + request + ) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_os_policy_assignment_report, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + async def list_os_policy_assignment_reports( + self, + request: Union[ + os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest, dict + ] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListOSPolicyAssignmentReportsAsyncPager: + r"""List OS policy asssignment reports for all Compute + Engine VM instances in the specified zone. + + + .. code-block:: python + + from google.cloud import osconfig_v1alpha + + def sample_list_os_policy_assignment_reports(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsRequest, dict]): + The request object. List the OS policy assignment + reports for VM instances. + parent (:class:`str`): + Required. The parent resource name. + + Format: + ``projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports`` + + For ``{project}``, either ``project-number`` or + ``project-id`` can be provided. For ``{instance}``, + either ``instance-name``, ``instance-id``, or ``-`` can + be provided. If '-' is provided, the response will + include OSPolicyAssignmentReports for all instances in + the project/location. For ``{assignment}``, either + ``assignment-id`` or ``-`` can be provided. If '-' is + provided, the response will include + OSPolicyAssignmentReports for all OSPolicyAssignments in + the project/location. Either {instance} or {assignment} + must be ``-``. + + For example: + ``projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports`` + returns all reports for the instance + ``projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports`` + returns all the reports for the given assignment across + all instances. + ``projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports`` + returns all the reports for all assignments across all + instances. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.osconfig_v1alpha.services.os_config_zonal_service.pagers.ListOSPolicyAssignmentReportsAsyncPager: + A response message for listing OS + Policy assignment reports including the + page of results and page token. + Iterating over this object will yield + results and resolve additional pages + automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest( + request + ) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.list_os_policy_assignment_reports, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListOSPolicyAssignmentReportsAsyncPager( + method=rpc, request=request, response=response, metadata=metadata, + ) + + # Done; return the response. + return response + async def get_inventory( self, request: Union[inventory.GetInventoryRequest, dict] = None, @@ -1228,7 +1501,7 @@ async def get_inventory( no associated inventory, the message ``NOT_FOUND`` is returned. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1244,7 +1517,7 @@ def sample_get_inventory(): # Make the request response = client.get_inventory(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1335,7 +1608,7 @@ async def list_inventories( specified zone. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1350,6 +1623,8 @@ def sample_list_inventories(): # Make the request page_result = client.list_inventories(request=request) + + # Handle the response for response in page_result: print(response) @@ -1361,12 +1636,10 @@ def sample_list_inventories(): Required. The parent resource name. Format: - ``projects/{project}/locations/{location}/instances/{instance}`` + ``projects/{project}/locations/{location}/instances/-`` For ``{project}``, either ``project-number`` or - ``project-id`` can be provided. For ``{instance}``, only - hyphen or dash character is supported to list - inventories across VMs. + ``project-id`` can be provided. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1444,7 +1717,7 @@ async def get_vulnerability_report( vulnerability reports associated with them. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1460,7 +1733,7 @@ def sample_get_vulnerability_report(): # Make the request response = client.get_vulnerability_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1547,7 +1820,7 @@ async def list_vulnerability_reports( the specified zone. - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1562,6 +1835,8 @@ def sample_list_vulnerability_reports(): # Make the request page_result = client.list_vulnerability_reports(request=request) + + # Handle the response for response in page_result: print(response) @@ -1574,12 +1849,10 @@ def sample_list_vulnerability_reports(): Required. The parent resource name. Format: - ``projects/{project}/locations/{location}/instances/{instance}`` + ``projects/{project}/locations/{location}/instances/-`` For ``{project}``, either ``project-number`` or - ``project-id`` can be provided. For ``{instance}``, only - ``-`` character is supported to list vulnerability - reports across VMs. + ``project-id`` can be provided. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/client.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/client.py index 334895cd676c..341dd435f084 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/client.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ import re from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources +import warnings from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -41,6 +42,7 @@ from google.cloud.osconfig_v1alpha.types import instance_os_policies_compliance from google.cloud.osconfig_v1alpha.types import inventory from google.cloud.osconfig_v1alpha.types import os_policy +from google.cloud.osconfig_v1alpha.types import os_policy_assignment_reports from google.cloud.osconfig_v1alpha.types import os_policy_assignments from google.cloud.osconfig_v1alpha.types import vulnerability from google.protobuf import empty_pb2 # type: ignore @@ -209,6 +211,27 @@ def parse_instance_os_policies_compliance_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def instance_os_policy_assignment_path( + project: str, location: str, instance: str, assignment: str, + ) -> str: + """Returns a fully-qualified instance_os_policy_assignment string.""" + return "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}".format( + project=project, + location=location, + instance=instance, + assignment=assignment, + ) + + @staticmethod + def parse_instance_os_policy_assignment_path(path: str) -> Dict[str, str]: + """Parses a instance_os_policy_assignment path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/instances/(?P.+?)/osPolicyAssignments/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def inventory_path(project: str, location: str, instance: str,) -> str: """Returns a fully-qualified inventory string.""" @@ -245,6 +268,27 @@ def parse_os_policy_assignment_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def os_policy_assignment_report_path( + project: str, location: str, instance: str, assignment: str, + ) -> str: + """Returns a fully-qualified os_policy_assignment_report string.""" + return "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report".format( + project=project, + location=location, + instance=instance, + assignment=assignment, + ) + + @staticmethod + def parse_os_policy_assignment_report_path(path: str) -> Dict[str, str]: + """Parses a os_policy_assignment_report path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/instances/(?P.+?)/osPolicyAssignments/(?P.+?)/report$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def vulnerability_report_path(project: str, location: str, instance: str,) -> str: """Returns a fully-qualified vulnerability_report string.""" @@ -511,8 +555,7 @@ def create_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -541,6 +584,8 @@ def sample_create_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -679,8 +724,7 @@ def update_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -707,6 +751,8 @@ def sample_update_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -821,8 +867,7 @@ def get_os_policy_assignment( revision ID in the ``name`` parameter. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -838,7 +883,7 @@ def sample_get_os_policy_assignment(): # Make the request response = client.get_os_policy_assignment(request=request) - # Handle response + # Handle the response print(response) Args: @@ -930,8 +975,7 @@ def list_os_policy_assignments( returned. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -946,6 +990,8 @@ def sample_list_os_policy_assignments(): # Make the request page_result = client.list_os_policy_assignments(request=request) + + # Handle the response for response in page_result: print(response) @@ -1035,8 +1081,7 @@ def list_os_policy_assignment_revisions( OS policy assignment. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1051,6 +1096,8 @@ def sample_list_os_policy_assignment_revisions(): # Make the request page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response for response in page_result: print(response) @@ -1155,8 +1202,7 @@ def delete_os_policy_assignment( projects.locations.osPolicyAssignments.operations.cancel `__. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1175,6 +1221,8 @@ def sample_delete_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) Args: @@ -1277,8 +1325,7 @@ def get_instance_os_policies_compliance( Compute Engine VM instance. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1294,7 +1341,7 @@ def sample_get_instance_os_policies_compliance(): # Make the request response = client.get_instance_os_policies_compliance(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1342,6 +1389,11 @@ def sample_get_instance_os_policies_compliance(): compliance](\ https://cloud.google.com/compute/docs/os-configuration-management/view-compliance). """ + warnings.warn( + "OsConfigZonalServiceClient.get_instance_os_policies_compliance is deprecated", + DeprecationWarning, + ) + # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. @@ -1402,8 +1454,7 @@ def list_instance_os_policies_compliances( Engine VM instances in the specified zone. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1418,6 +1469,8 @@ def sample_list_instance_os_policies_compliances(): # Make the request page_result = client.list_instance_os_policies_compliances(request=request) + + # Handle the response for response in page_result: print(response) @@ -1453,6 +1506,11 @@ def sample_list_instance_os_policies_compliances(): automatically. """ + warnings.warn( + "OsConfigZonalServiceClient.list_instance_os_policies_compliances is deprecated", + DeprecationWarning, + ) + # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. @@ -1503,6 +1561,251 @@ def sample_list_instance_os_policies_compliances(): # Done; return the response. return response + def get_os_policy_assignment_report( + self, + request: Union[ + os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest, dict + ] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> os_policy_assignment_reports.OSPolicyAssignmentReport: + r"""Get the OS policy asssignment report for the + specified Compute Engine VM instance. + + + .. code-block:: python + + from google.cloud import osconfig_v1alpha + + def sample_get_os_policy_assignment_report(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetOSPolicyAssignmentReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_os_policy_assignment_report(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.osconfig_v1alpha.types.GetOSPolicyAssignmentReportRequest, dict]): + The request object. Get a report of the OS policy + assignment for a VM instance. + name (str): + Required. API resource name for OS policy assignment + report. + + Format: + ``/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report`` + + For ``{project}``, either ``project-number`` or + ``project-id`` can be provided. For ``{instance_id}``, + either Compute Engine ``instance-id`` or + ``instance-name`` can be provided. For + ``{assignment_id}``, the OSPolicyAssignment id must be + provided. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport: + A report of the OS policy assignment + status for a given instance. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest + ): + request = os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.get_os_policy_assignment_report + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + def list_os_policy_assignment_reports( + self, + request: Union[ + os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest, dict + ] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListOSPolicyAssignmentReportsPager: + r"""List OS policy asssignment reports for all Compute + Engine VM instances in the specified zone. + + + .. code-block:: python + + from google.cloud import osconfig_v1alpha + + def sample_list_os_policy_assignment_reports(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsRequest, dict]): + The request object. List the OS policy assignment + reports for VM instances. + parent (str): + Required. The parent resource name. + + Format: + ``projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports`` + + For ``{project}``, either ``project-number`` or + ``project-id`` can be provided. For ``{instance}``, + either ``instance-name``, ``instance-id``, or ``-`` can + be provided. If '-' is provided, the response will + include OSPolicyAssignmentReports for all instances in + the project/location. For ``{assignment}``, either + ``assignment-id`` or ``-`` can be provided. If '-' is + provided, the response will include + OSPolicyAssignmentReports for all OSPolicyAssignments in + the project/location. Either {instance} or {assignment} + must be ``-``. + + For example: + ``projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports`` + returns all reports for the instance + ``projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports`` + returns all the reports for the given assignment across + all instances. + ``projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports`` + returns all the reports for all assignments across all + instances. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.osconfig_v1alpha.services.os_config_zonal_service.pagers.ListOSPolicyAssignmentReportsPager: + A response message for listing OS + Policy assignment reports including the + page of results and page token. + Iterating over this object will yield + results and resolve additional pages + automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest + ): + request = os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.list_os_policy_assignment_reports + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListOSPolicyAssignmentReportsPager( + method=rpc, request=request, response=response, metadata=metadata, + ) + + # Done; return the response. + return response + def get_inventory( self, request: Union[inventory.GetInventoryRequest, dict] = None, @@ -1516,8 +1819,7 @@ def get_inventory( no associated inventory, the message ``NOT_FOUND`` is returned. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1533,7 +1835,7 @@ def sample_get_inventory(): # Make the request response = client.get_inventory(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1624,8 +1926,7 @@ def list_inventories( specified zone. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1640,6 +1941,8 @@ def sample_list_inventories(): # Make the request page_result = client.list_inventories(request=request) + + # Handle the response for response in page_result: print(response) @@ -1651,12 +1954,10 @@ def sample_list_inventories(): Required. The parent resource name. Format: - ``projects/{project}/locations/{location}/instances/{instance}`` + ``projects/{project}/locations/{location}/instances/-`` For ``{project}``, either ``project-number`` or - ``project-id`` can be provided. For ``{instance}``, only - hyphen or dash character is supported to list - inventories across VMs. + ``project-id`` can be provided. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1734,8 +2035,7 @@ def get_vulnerability_report( vulnerability reports associated with them. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1751,7 +2051,7 @@ def sample_get_vulnerability_report(): # Make the request response = client.get_vulnerability_report(request=request) - # Handle response + # Handle the response print(response) Args: @@ -1838,8 +2138,7 @@ def list_vulnerability_reports( the specified zone. - - .. code-block:: + .. code-block:: python from google.cloud import osconfig_v1alpha @@ -1854,6 +2153,8 @@ def sample_list_vulnerability_reports(): # Make the request page_result = client.list_vulnerability_reports(request=request) + + # Handle the response for response in page_result: print(response) @@ -1866,12 +2167,10 @@ def sample_list_vulnerability_reports(): Required. The parent resource name. Format: - ``projects/{project}/locations/{location}/instances/{instance}`` + ``projects/{project}/locations/{location}/instances/-`` For ``{project}``, either ``project-number`` or - ``project-id`` can be provided. For ``{instance}``, only - ``-`` character is supported to list vulnerability - reports across VMs. + ``project-id`` can be provided. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/pagers.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/pagers.py index c65594c60334..8e933f7fc0c3 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/pagers.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ from google.cloud.osconfig_v1alpha.types import instance_os_policies_compliance from google.cloud.osconfig_v1alpha.types import inventory +from google.cloud.osconfig_v1alpha.types import os_policy_assignment_reports from google.cloud.osconfig_v1alpha.types import os_policy_assignments from google.cloud.osconfig_v1alpha.types import vulnerability @@ -455,6 +456,155 @@ def __repr__(self) -> str: return "{0}<{1!r}>".format(self.__class__.__name__, self._response) +class ListOSPolicyAssignmentReportsPager: + """A pager for iterating through ``list_os_policy_assignment_reports`` requests. + + This class thinly wraps an initial + :class:`google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``os_policy_assignment_reports`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListOSPolicyAssignmentReports`` requests and continue to iterate + through the ``os_policy_assignment_reports`` field on the + corresponding responses. + + All the usual :class:`google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[ + ..., os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse + ], + request: os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest, + response: os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsRequest): + The initial request object. + response (google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest( + request + ) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages( + self, + ) -> Iterator[os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__( + self, + ) -> Iterator[os_policy_assignment_reports.OSPolicyAssignmentReport]: + for page in self.pages: + yield from page.os_policy_assignment_reports + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + +class ListOSPolicyAssignmentReportsAsyncPager: + """A pager for iterating through ``list_os_policy_assignment_reports`` requests. + + This class thinly wraps an initial + :class:`google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``os_policy_assignment_reports`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListOSPolicyAssignmentReports`` requests and continue to iterate + through the ``os_policy_assignment_reports`` field on the + corresponding responses. + + All the usual :class:`google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[ + ..., + Awaitable[ + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse + ], + ], + request: os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest, + response: os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsRequest): + The initial request object. + response (google.cloud.osconfig_v1alpha.types.ListOSPolicyAssignmentReportsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest( + request + ) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages( + self, + ) -> AsyncIterator[ + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse + ]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + + def __aiter__( + self, + ) -> AsyncIterator[os_policy_assignment_reports.OSPolicyAssignmentReport]: + async def async_generator(): + async for page in self.pages: + for response in page.os_policy_assignment_reports: + yield response + + return async_generator() + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + class ListInventoriesPager: """A pager for iterating through ``list_inventories`` requests. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/__init__.py index c070e43930b9..5328c9db4d90 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/base.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/base.py index d2ef8e07a8bb..59e629f86ff2 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/base.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ from google.cloud.osconfig_v1alpha.types import instance_os_policies_compliance from google.cloud.osconfig_v1alpha.types import inventory +from google.cloud.osconfig_v1alpha.types import os_policy_assignment_reports from google.cloud.osconfig_v1alpha.types import os_policy_assignments from google.cloud.osconfig_v1alpha.types import vulnerability from google.longrunning import operations_pb2 # type: ignore @@ -163,6 +164,16 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.get_os_policy_assignment_report: gapic_v1.method.wrap_method( + self.get_os_policy_assignment_report, + default_timeout=None, + client_info=client_info, + ), + self.list_os_policy_assignment_reports: gapic_v1.method.wrap_method( + self.list_os_policy_assignment_reports, + default_timeout=None, + client_info=client_info, + ), self.get_inventory: gapic_v1.method.wrap_method( self.get_inventory, default_timeout=None, client_info=client_info, ), @@ -284,6 +295,32 @@ def list_instance_os_policies_compliances( ]: raise NotImplementedError() + @property + def get_os_policy_assignment_report( + self, + ) -> Callable[ + [os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest], + Union[ + os_policy_assignment_reports.OSPolicyAssignmentReport, + Awaitable[os_policy_assignment_reports.OSPolicyAssignmentReport], + ], + ]: + raise NotImplementedError() + + @property + def list_os_policy_assignment_reports( + self, + ) -> Callable[ + [os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest], + Union[ + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse, + Awaitable[ + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse + ], + ], + ]: + raise NotImplementedError() + @property def get_inventory( self, diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/grpc.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/grpc.py index c63a6031adbd..9cf38f96b6b8 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/grpc.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ from google.cloud.osconfig_v1alpha.types import instance_os_policies_compliance from google.cloud.osconfig_v1alpha.types import inventory +from google.cloud.osconfig_v1alpha.types import os_policy_assignment_reports from google.cloud.osconfig_v1alpha.types import os_policy_assignments from google.cloud.osconfig_v1alpha.types import vulnerability from google.longrunning import operations_pb2 # type: ignore @@ -533,6 +534,72 @@ def list_instance_os_policies_compliances( ) return self._stubs["list_instance_os_policies_compliances"] + @property + def get_os_policy_assignment_report( + self, + ) -> Callable[ + [os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest], + os_policy_assignment_reports.OSPolicyAssignmentReport, + ]: + r"""Return a callable for the get os policy assignment + report method over gRPC. + + Get the OS policy asssignment report for the + specified Compute Engine VM instance. + + Returns: + Callable[[~.GetOSPolicyAssignmentReportRequest], + ~.OSPolicyAssignmentReport]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_os_policy_assignment_report" not in self._stubs: + self._stubs[ + "get_os_policy_assignment_report" + ] = self.grpc_channel.unary_unary( + "/google.cloud.osconfig.v1alpha.OsConfigZonalService/GetOSPolicyAssignmentReport", + request_serializer=os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest.serialize, + response_deserializer=os_policy_assignment_reports.OSPolicyAssignmentReport.deserialize, + ) + return self._stubs["get_os_policy_assignment_report"] + + @property + def list_os_policy_assignment_reports( + self, + ) -> Callable[ + [os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest], + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse, + ]: + r"""Return a callable for the list os policy assignment + reports method over gRPC. + + List OS policy asssignment reports for all Compute + Engine VM instances in the specified zone. + + Returns: + Callable[[~.ListOSPolicyAssignmentReportsRequest], + ~.ListOSPolicyAssignmentReportsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_os_policy_assignment_reports" not in self._stubs: + self._stubs[ + "list_os_policy_assignment_reports" + ] = self.grpc_channel.unary_unary( + "/google.cloud.osconfig.v1alpha.OsConfigZonalService/ListOSPolicyAssignmentReports", + request_serializer=os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest.serialize, + response_deserializer=os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse.deserialize, + ) + return self._stubs["list_os_policy_assignment_reports"] + @property def get_inventory( self, diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/grpc_asyncio.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/grpc_asyncio.py index aa61d01ba8d6..b592f310167c 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/services/os_config_zonal_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ from google.cloud.osconfig_v1alpha.types import instance_os_policies_compliance from google.cloud.osconfig_v1alpha.types import inventory +from google.cloud.osconfig_v1alpha.types import os_policy_assignment_reports from google.cloud.osconfig_v1alpha.types import os_policy_assignments from google.cloud.osconfig_v1alpha.types import vulnerability from google.longrunning import operations_pb2 # type: ignore @@ -539,6 +540,72 @@ def list_instance_os_policies_compliances( ) return self._stubs["list_instance_os_policies_compliances"] + @property + def get_os_policy_assignment_report( + self, + ) -> Callable[ + [os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest], + Awaitable[os_policy_assignment_reports.OSPolicyAssignmentReport], + ]: + r"""Return a callable for the get os policy assignment + report method over gRPC. + + Get the OS policy asssignment report for the + specified Compute Engine VM instance. + + Returns: + Callable[[~.GetOSPolicyAssignmentReportRequest], + Awaitable[~.OSPolicyAssignmentReport]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_os_policy_assignment_report" not in self._stubs: + self._stubs[ + "get_os_policy_assignment_report" + ] = self.grpc_channel.unary_unary( + "/google.cloud.osconfig.v1alpha.OsConfigZonalService/GetOSPolicyAssignmentReport", + request_serializer=os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest.serialize, + response_deserializer=os_policy_assignment_reports.OSPolicyAssignmentReport.deserialize, + ) + return self._stubs["get_os_policy_assignment_report"] + + @property + def list_os_policy_assignment_reports( + self, + ) -> Callable[ + [os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest], + Awaitable[os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse], + ]: + r"""Return a callable for the list os policy assignment + reports method over gRPC. + + List OS policy asssignment reports for all Compute + Engine VM instances in the specified zone. + + Returns: + Callable[[~.ListOSPolicyAssignmentReportsRequest], + Awaitable[~.ListOSPolicyAssignmentReportsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_os_policy_assignment_reports" not in self._stubs: + self._stubs[ + "list_os_policy_assignment_reports" + ] = self.grpc_channel.unary_unary( + "/google.cloud.osconfig.v1alpha.OsConfigZonalService/ListOSPolicyAssignmentReports", + request_serializer=os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest.serialize, + response_deserializer=os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse.deserialize, + ) + return self._stubs["list_os_policy_assignment_reports"] + @property def get_inventory( self, diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/__init__.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/__init__.py index 7cb3abb1617c..f24c5dbdda90 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/__init__.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,6 +32,12 @@ InventoryView, ) from .os_policy import OSPolicy +from .os_policy_assignment_reports import ( + GetOSPolicyAssignmentReportRequest, + ListOSPolicyAssignmentReportsRequest, + ListOSPolicyAssignmentReportsResponse, + OSPolicyAssignmentReport, +) from .os_policy_assignments import ( CreateOSPolicyAssignmentRequest, DeleteOSPolicyAssignmentRequest, @@ -67,6 +73,10 @@ "ListInventoriesResponse", "InventoryView", "OSPolicy", + "GetOSPolicyAssignmentReportRequest", + "ListOSPolicyAssignmentReportsRequest", + "ListOSPolicyAssignmentReportsResponse", + "OSPolicyAssignmentReport", "CreateOSPolicyAssignmentRequest", "DeleteOSPolicyAssignmentRequest", "GetOSPolicyAssignmentRequest", diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/config_common.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/config_common.py index 0dea17fef7cd..d2d1edb28ee7 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/config_common.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/config_common.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ class OSPolicyComplianceState(proto.Enum): r"""Supported OSPolicy compliance states.""" + _pb_options = {"deprecated": True} OS_POLICY_COMPLIANCE_STATE_UNSPECIFIED = 0 COMPLIANT = 1 NON_COMPLIANT = 2 @@ -52,6 +53,7 @@ class OSPolicyResourceConfigStep(proto.Message): class Type(proto.Enum): r"""Supported configuration step types""" + _pb_options = {"deprecated": True} TYPE_UNSPECIFIED = 0 VALIDATION = 1 DESIRED_STATE_CHECK = 2 @@ -60,6 +62,7 @@ class Type(proto.Enum): class Outcome(proto.Enum): r"""Supported outcomes for a configuration step.""" + _pb_options = {"deprecated": True} OUTCOME_UNSPECIFIED = 0 SUCCEEDED = 1 FAILED = 2 diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/instance_os_policies_compliance.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/instance_os_policies_compliance.py index 8702cd3c59ff..8a2dd5dec2c4 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/instance_os_policies_compliance.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/instance_os_policies_compliance.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/inventory.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/inventory.py index 8f8d69afdb7b..67d39ba84fd4 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/inventory.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/inventory.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -423,12 +423,10 @@ class WindowsQuickFixEngineeringPackage(proto.Message): ) class WindowsApplication(proto.Message): - r"""Contains information about a Windows application as retrieved from - the Windows Registry. For more information about these fields, see - - `Windows Installer Properties for the Uninstall - Registry `__\ {: - class="external" } + r"""Contains information about a Windows application that is + retrieved from the Windows Registry. For more information about + these fields, see: + https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key Attributes: display_name (str): @@ -495,12 +493,10 @@ class ListInventoriesRequest(proto.Message): Required. The parent resource name. Format: - ``projects/{project}/locations/{location}/instances/{instance}`` + ``projects/{project}/locations/{location}/instances/-`` For ``{project}``, either ``project-number`` or - ``project-id`` can be provided. For ``{instance}``, only - hyphen or dash character is supported to list inventories - across VMs. + ``project-id`` can be provided. view (google.cloud.osconfig_v1alpha.types.InventoryView): Inventory view indicating what information should be included in the inventory resource. If diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy.py index e4ae3ea31af8..d0c13c27129c 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -67,8 +67,7 @@ class Mode(proto.Enum): ENFORCEMENT = 2 class OSFilter(proto.Message): - r"""The ``OSFilter`` is used to specify the OS filtering criteria for - the resource group. + r"""Filtering criteria to select VMs based on OS details. Attributes: os_short_name (str): @@ -86,6 +85,26 @@ class OSFilter(proto.Message): os_short_name = proto.Field(proto.STRING, number=1,) os_version = proto.Field(proto.STRING, number=2,) + class InventoryFilter(proto.Message): + r"""Filtering criteria to select VMs based on inventory details. + + Attributes: + os_short_name (str): + Required. The OS short name + os_version (str): + The OS version + + Prefix matches are supported if asterisk(*) is provided as + the last character. For example, to match all versions with + a major version of ``7``, specify the following value for + this field ``7.*`` + + An empty string matches all OS versions. + """ + + os_short_name = proto.Field(proto.STRING, number=1,) + os_version = proto.Field(proto.STRING, number=2,) + class Resource(proto.Message): r"""An OS policy resource is used to define the desired state configuration and provides a specific functionality like @@ -791,8 +810,23 @@ class ResourceGroup(proto.Message): Attributes: os_filter (google.cloud.osconfig_v1alpha.types.OSPolicy.OSFilter): - Used to specify the OS filter for a resource - group + Deprecated. Use the ``inventory_filters`` field instead. + Used to specify the OS filter for a resource group + inventory_filters (Sequence[google.cloud.osconfig_v1alpha.types.OSPolicy.InventoryFilter]): + List of inventory filters for the resource group. + + The resources in this resource group are applied to the + target VM if it satisfies at least one of the following + inventory filters. + + For example, to apply this resource group to VMs running + either ``RHEL`` or ``CentOS`` operating systems, specify 2 + items for the list with following values: + inventory_filters[0].os_short_name='rhel' and + inventory_filters[1].os_short_name='centos' + + If the list is empty, this resource group will be applied to + the target VM unconditionally. resources (Sequence[google.cloud.osconfig_v1alpha.types.OSPolicy.Resource]): Required. List of resources configured for this resource group. The resources are executed @@ -800,6 +834,9 @@ class ResourceGroup(proto.Message): """ os_filter = proto.Field(proto.MESSAGE, number=1, message="OSPolicy.OSFilter",) + inventory_filters = proto.RepeatedField( + proto.MESSAGE, number=3, message="OSPolicy.InventoryFilter", + ) resources = proto.RepeatedField( proto.MESSAGE, number=2, message="OSPolicy.Resource", ) diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy_assignment_reports.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy_assignment_reports.py new file mode 100644 index 000000000000..350aad70920a --- /dev/null +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy_assignment_reports.py @@ -0,0 +1,329 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import proto # type: ignore + +from google.protobuf import timestamp_pb2 # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.osconfig.v1alpha", + manifest={ + "GetOSPolicyAssignmentReportRequest", + "ListOSPolicyAssignmentReportsRequest", + "ListOSPolicyAssignmentReportsResponse", + "OSPolicyAssignmentReport", + }, +) + + +class GetOSPolicyAssignmentReportRequest(proto.Message): + r"""Get a report of the OS policy assignment for a VM instance. + + Attributes: + name (str): + Required. API resource name for OS policy assignment report. + + Format: + ``/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report`` + + For ``{project}``, either ``project-number`` or + ``project-id`` can be provided. For ``{instance_id}``, + either Compute Engine ``instance-id`` or ``instance-name`` + can be provided. For ``{assignment_id}``, the + OSPolicyAssignment id must be provided. + """ + + name = proto.Field(proto.STRING, number=1,) + + +class ListOSPolicyAssignmentReportsRequest(proto.Message): + r"""List the OS policy assignment reports for VM instances. + + Attributes: + parent (str): + Required. The parent resource name. + + Format: + ``projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports`` + + For ``{project}``, either ``project-number`` or + ``project-id`` can be provided. For ``{instance}``, either + ``instance-name``, ``instance-id``, or ``-`` can be + provided. If '-' is provided, the response will include + OSPolicyAssignmentReports for all instances in the + project/location. For ``{assignment}``, either + ``assignment-id`` or ``-`` can be provided. If '-' is + provided, the response will include + OSPolicyAssignmentReports for all OSPolicyAssignments in the + project/location. Either {instance} or {assignment} must be + ``-``. + + For example: + ``projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports`` + returns all reports for the instance + ``projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports`` + returns all the reports for the given assignment across all + instances. + ``projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports`` + returns all the reports for all assignments across all + instances. + page_size (int): + The maximum number of results to return. + filter (str): + If provided, this field specifies the criteria that must be + met by the ``OSPolicyAssignmentReport`` API resource that is + included in the response. + page_token (str): + A pagination token returned from a previous call to the + ``ListOSPolicyAssignmentReports`` method that indicates + where this listing should continue from. + """ + + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + filter = proto.Field(proto.STRING, number=3,) + page_token = proto.Field(proto.STRING, number=4,) + + +class ListOSPolicyAssignmentReportsResponse(proto.Message): + r"""A response message for listing OS Policy assignment reports + including the page of results and page token. + + Attributes: + os_policy_assignment_reports (Sequence[google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport]): + List of OS policy assignment reports. + next_page_token (str): + The pagination token to retrieve the next + page of OS policy assignment report objects. + """ + + @property + def raw_page(self): + return self + + os_policy_assignment_reports = proto.RepeatedField( + proto.MESSAGE, number=1, message="OSPolicyAssignmentReport", + ) + next_page_token = proto.Field(proto.STRING, number=2,) + + +class OSPolicyAssignmentReport(proto.Message): + r"""A report of the OS policy assignment status for a given + instance. + + Attributes: + name (str): + The ``OSPolicyAssignmentReport`` API resource name. + + Format: + ``projects/{project_number}/locations/{location}/instances/{instance_id}/osPolicyAssignments/{os_policy_assignment_id}/report`` + instance (str): + The Compute Engine VM instance name. + os_policy_assignment (str): + Reference to the ``OSPolicyAssignment`` API resource that + the ``OSPolicy`` belongs to. + + Format: + ``projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}`` + os_policy_compliances (Sequence[google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport.OSPolicyCompliance]): + Compliance data for each ``OSPolicy`` that is applied to the + VM. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp for when the report was last + generated. + last_run_id (str): + Unique identifier of the last attempted run + to apply the OS policies associated with this + assignment on the VM. + This ID is logged by the OS Config agent while + applying the OS policies associated with this + assignment on the VM. NOTE: If the service is + unable to successfully connect to the agent for + this run, then this id will not be available in + the agent logs. + """ + + class OSPolicyCompliance(proto.Message): + r"""Compliance data for an OS policy + + Attributes: + os_policy_id (str): + The OS policy id + compliance_state (google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState): + The compliance state of the OS policy. + compliance_state_reason (str): + The reason for the OS policy to be in an unknown compliance + state. This field is always populated when + ``compliance_state`` is ``UNKNOWN``. + + If populated, the field can contain one of the following + values: + + - ``vm-not-running``: The VM was not running. + - ``os-policies-not-supported-by-agent``: The version of + the OS Config agent running on the VM does not support + running OS policies. + - ``no-agent-detected``: The OS Config agent is not + detected for the VM. + - ``resource-execution-errors``: The OS Config agent + encountered errors while executing one or more resources + in the policy. See ``os_policy_resource_compliances`` for + details. + - ``task-timeout``: The task sent to the agent to apply the + policy timed out. + - ``unexpected-agent-state``: The OS Config agent did not + report the final status of the task that attempted to + apply the policy. Instead, the agent unexpectedly started + working on a different task. This mostly happens when the + agent or VM unexpectedly restarts while applying OS + policies. + - ``internal-service-errors``: Internal service errors were + encountered while attempting to apply the policy. + os_policy_resource_compliances (Sequence[google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance]): + Compliance data for each resource within the + policy that is applied to the VM. + """ + + class ComplianceState(proto.Enum): + r"""Possible compliance states for an os policy.""" + UNKNOWN = 0 + COMPLIANT = 1 + NON_COMPLIANT = 2 + + class OSPolicyResourceCompliance(proto.Message): + r"""Compliance data for an OS policy resource. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + os_policy_resource_id (str): + The ID of the OS policy resource. + config_steps (Sequence[google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep]): + Ordered list of configuration completed by + the agent for the OS policy resource. + compliance_state (google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState): + The compliance state of the resource. + compliance_state_reason (str): + A reason for the resource to be in the given compliance + state. This field is always populated when + ``compliance_state`` is ``UNKNOWN``. + + The following values are supported when + ``compliance_state == UNKNOWN`` + + - ``execution-errors``: Errors were encountered by the + agent while executing the resource and the compliance + state couldn't be determined. + - ``execution-skipped-by-agent``: Resource execution was + skipped by the agent because errors were encountered + while executing prior resources in the OS policy. + - ``os-policy-execution-attempt-failed``: The execution of + the OS policy containing this resource failed and the + compliance state couldn't be determined. + exec_resource_output (google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput): + ExecResource specific output. + + This field is a member of `oneof`_ ``output``. + """ + + class ComplianceState(proto.Enum): + r"""Possible compliance states for a resource.""" + UNKNOWN = 0 + COMPLIANT = 1 + NON_COMPLIANT = 2 + + class OSPolicyResourceConfigStep(proto.Message): + r"""Step performed by the OS Config agent for configuring an + ``OSPolicy`` resource to its desired state. + + Attributes: + type_ (google.cloud.osconfig_v1alpha.types.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type): + Configuration step type. + error_message (str): + An error message recorded during the + execution of this step. Only populated if errors + were encountered during this step execution. + """ + + class Type(proto.Enum): + r"""Supported configuration step types""" + TYPE_UNSPECIFIED = 0 + VALIDATION = 1 + DESIRED_STATE_CHECK = 2 + DESIRED_STATE_ENFORCEMENT = 3 + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4 + + type_ = proto.Field( + proto.ENUM, + number=1, + enum="OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep.Type", + ) + error_message = proto.Field(proto.STRING, number=2,) + + class ExecResourceOutput(proto.Message): + r"""ExecResource specific output. + + Attributes: + enforcement_output (bytes): + Output from enforcement phase output file (if + run). Output size is limited to 100K bytes. + """ + + enforcement_output = proto.Field(proto.BYTES, number=2,) + + os_policy_resource_id = proto.Field(proto.STRING, number=1,) + config_steps = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.OSPolicyResourceConfigStep", + ) + compliance_state = proto.Field( + proto.ENUM, + number=3, + enum="OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState", + ) + compliance_state_reason = proto.Field(proto.STRING, number=4,) + exec_resource_output = proto.Field( + proto.MESSAGE, + number=5, + oneof="output", + message="OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ExecResourceOutput", + ) + + os_policy_id = proto.Field(proto.STRING, number=1,) + compliance_state = proto.Field( + proto.ENUM, + number=2, + enum="OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState", + ) + compliance_state_reason = proto.Field(proto.STRING, number=3,) + os_policy_resource_compliances = proto.RepeatedField( + proto.MESSAGE, + number=4, + message="OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance", + ) + + name = proto.Field(proto.STRING, number=1,) + instance = proto.Field(proto.STRING, number=2,) + os_policy_assignment = proto.Field(proto.STRING, number=3,) + os_policy_compliances = proto.RepeatedField( + proto.MESSAGE, number=4, message=OSPolicyCompliance, + ) + update_time = proto.Field(proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp,) + last_run_id = proto.Field(proto.STRING, number=6,) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy_assignments.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy_assignments.py index 67a4349e7820..f4f9c48e627c 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy_assignments.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/os_policy_assignments.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -89,6 +89,10 @@ class OSPolicyAssignment(proto.Message): revision_create_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The timestamp that the revision was created. + etag (str): + The etag for this OS policy assignment. + If this is provided on update, it must match the + server's etag. rollout_state (google.cloud.osconfig_v1alpha.types.OSPolicyAssignment.RolloutState): Output only. OS policy assignment rollout state @@ -144,17 +148,18 @@ class LabelSet(proto.Message): labels = proto.MapField(proto.STRING, proto.STRING, number=1,) class InstanceFilter(proto.Message): - r"""Message to represent the filters to select VMs for an - assignment + r"""Filters to select target VMs for an assignment. + If more than one filter criteria is specified below, a VM will + be selected if and only if it satisfies all of them. Attributes: all_ (bool): Target all VMs in the project. If true, no other criteria is permitted. os_short_names (Sequence[str]): - A VM is included if it's OS short name - matches with any of the values provided in this - list. + Deprecated. Use the ``inventories`` field instead. A VM is + selected if it's OS short name matches with any of the + values provided in this list. inclusion_labels (Sequence[google.cloud.osconfig_v1alpha.types.OSPolicyAssignment.LabelSet]): List of label sets used for VM inclusion. @@ -165,13 +170,32 @@ class InstanceFilter(proto.Message): If the list has more than one label set, the VM is excluded if any of the label sets are applicable for the VM. - - This filter is applied last in the filtering - chain and therefore a VM is guaranteed to be - excluded if it satisfies one of the below label - sets. + inventories (Sequence[google.cloud.osconfig_v1alpha.types.OSPolicyAssignment.InstanceFilter.Inventory]): + List of inventories to select VMs. + A VM is selected if its inventory data matches + at least one of the following inventories. """ + class Inventory(proto.Message): + r"""VM inventory details. + + Attributes: + os_short_name (str): + Required. The OS short name + os_version (str): + The OS version + + Prefix matches are supported if asterisk(*) is provided as + the last character. For example, to match all versions with + a major version of ``7``, specify the following value for + this field ``7.*`` + + An empty string matches all OS versions. + """ + + os_short_name = proto.Field(proto.STRING, number=1,) + os_version = proto.Field(proto.STRING, number=2,) + all_ = proto.Field(proto.BOOL, number=1,) os_short_names = proto.RepeatedField(proto.STRING, number=2,) inclusion_labels = proto.RepeatedField( @@ -180,6 +204,11 @@ class InstanceFilter(proto.Message): exclusion_labels = proto.RepeatedField( proto.MESSAGE, number=4, message="OSPolicyAssignment.LabelSet", ) + inventories = proto.RepeatedField( + proto.MESSAGE, + number=5, + message="OSPolicyAssignment.InstanceFilter.Inventory", + ) class Rollout(proto.Message): r"""Message to configure the rollout at the zonal level for the @@ -215,6 +244,7 @@ class Rollout(proto.Message): revision_create_time = proto.Field( proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp, ) + etag = proto.Field(proto.STRING, number=8,) rollout_state = proto.Field(proto.ENUM, number=9, enum=RolloutState,) baseline = proto.Field(proto.BOOL, number=10,) deleted = proto.Field(proto.BOOL, number=11,) diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/osconfig_common.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/osconfig_common.py index e7cd41262aa2..afdaf63e9555 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/osconfig_common.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/osconfig_common.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/osconfig_zonal_service.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/osconfig_zonal_service.py index fc350733121a..5d58e561ee01 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/osconfig_zonal_service.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/osconfig_zonal_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/vulnerability.py b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/vulnerability.py index 49f9cf249996..8beac7573d87 100644 --- a/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/vulnerability.py +++ b/packages/google-cloud-os-config/google/cloud/osconfig_v1alpha/types/vulnerability.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -80,6 +80,8 @@ class Vulnerability(proto.Message): update_time (google.protobuf.timestamp_pb2.Timestamp): The timestamp for when the vulnerability was last modified. + items (Sequence[google.cloud.osconfig_v1alpha.types.VulnerabilityReport.Vulnerability.Item]): + List of items affected by the vulnerability. """ class Details(proto.Message): @@ -118,9 +120,12 @@ class Reference(proto.Message): Attributes: url (str): The url of the reference. + source (str): + The source of the reference e.g. NVD. """ url = proto.Field(proto.STRING, number=1,) + source = proto.Field(proto.STRING, number=2,) cve = proto.Field(proto.STRING, number=1,) cvss_v2_score = proto.Field(proto.FLOAT, number=2,) @@ -133,6 +138,40 @@ class Reference(proto.Message): message="VulnerabilityReport.Vulnerability.Details.Reference", ) + class Item(proto.Message): + r"""OS inventory item that is affected by a vulnerability or + fixed as a result of a vulnerability. + + Attributes: + installed_inventory_item_id (str): + Corresponds to the ``INSTALLED_PACKAGE`` inventory item on + the VM. This field displays the inventory items affected by + this vulnerability. If the vulnerability report was not + updated after the VM inventory update, these values might + not display in VM inventory. For some operating systems, + this field might be empty. + available_inventory_item_id (str): + Corresponds to the ``AVAILABLE_PACKAGE`` inventory item on + the VM. If the vulnerability report was not updated after + the VM inventory update, these values might not display in + VM inventory. If there is no available fix, the field is + empty. The ``inventory_item`` value specifies the latest + ``SoftwarePackage`` available to the VM that fixes the + vulnerability. + fixed_cpe_uri (str): + The recommended `CPE + URI `__ update that + contains a fix for this vulnerability. + upstream_fix (str): + The upstream OS patch, packages or KB that + fixes the vulnerability. + """ + + installed_inventory_item_id = proto.Field(proto.STRING, number=1,) + available_inventory_item_id = proto.Field(proto.STRING, number=2,) + fixed_cpe_uri = proto.Field(proto.STRING, number=3,) + upstream_fix = proto.Field(proto.STRING, number=4,) + details = proto.Field( proto.MESSAGE, number=1, @@ -146,6 +185,9 @@ class Reference(proto.Message): update_time = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) + items = proto.RepeatedField( + proto.MESSAGE, number=6, message="VulnerabilityReport.Vulnerability.Item", + ) name = proto.Field(proto.STRING, number=1,) vulnerabilities = proto.RepeatedField( @@ -183,12 +225,10 @@ class ListVulnerabilityReportsRequest(proto.Message): Required. The parent resource name. Format: - ``projects/{project}/locations/{location}/instances/{instance}`` + ``projects/{project}/locations/{location}/instances/-`` For ``{project}``, either ``project-number`` or - ``project-id`` can be provided. For ``{instance}``, only - ``-`` character is supported to list vulnerability reports - across VMs. + ``project-id`` can be provided. page_size (int): The maximum number of results to return. page_token (str): diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_async.py index a9031c925049..9c31c1460dcc 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_async.py @@ -39,7 +39,7 @@ async def sample_cancel_patch_job(): # Make the request response = await client.cancel_patch_job(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_CancelPatchJob_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_sync.py index ab88e7f340a8..f4c36389fc90 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_sync.py @@ -39,7 +39,7 @@ def sample_cancel_patch_job(): # Make the request response = client.cancel_patch_job(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_CancelPatchJob_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_async.py index 41fb80e8bfc8..5483bd4fb741 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_async.py @@ -40,7 +40,7 @@ async def sample_create_patch_deployment(): # Make the request response = await client.create_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_CreatePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_sync.py index daffa4fa61da..ba1cfe3965a4 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_sync.py @@ -40,7 +40,7 @@ def sample_create_patch_deployment(): # Make the request response = client.create_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_CreatePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_async.py index a71e2c94bcd7..4f494919fcd6 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_async.py @@ -37,7 +37,7 @@ async def sample_delete_patch_deployment(): ) # Make the request - response = await client.delete_patch_deployment(request=request) + await client.delete_patch_deployment(request=request) # [END osconfig_generated_osconfig_v1_OsConfigService_DeletePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_sync.py index 7287fe7b1def..e4eebe860ce0 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_sync.py @@ -37,7 +37,7 @@ def sample_delete_patch_deployment(): ) # Make the request - response = client.delete_patch_deployment(request=request) + client.delete_patch_deployment(request=request) # [END osconfig_generated_osconfig_v1_OsConfigService_DeletePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_async.py index ff3861eec98d..bdfafafcaa8a 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_async.py @@ -39,7 +39,7 @@ async def sample_execute_patch_job(): # Make the request response = await client.execute_patch_job(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_ExecutePatchJob_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_sync.py index 974b7ff266be..12f037ce40f5 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_sync.py @@ -39,7 +39,7 @@ def sample_execute_patch_job(): # Make the request response = client.execute_patch_job(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_ExecutePatchJob_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_async.py index c4ac3e280433..a97d4c43df71 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_async.py @@ -39,7 +39,7 @@ async def sample_get_patch_deployment(): # Make the request response = await client.get_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_GetPatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_sync.py index fa99b5c5693e..3d334aa13c33 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_sync.py @@ -39,7 +39,7 @@ def sample_get_patch_deployment(): # Make the request response = client.get_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_GetPatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_job_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_job_async.py index 7026960f4276..b90caf450b6f 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_job_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_job_async.py @@ -39,7 +39,7 @@ async def sample_get_patch_job(): # Make the request response = await client.get_patch_job(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_GetPatchJob_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_job_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_job_sync.py index 613c7d4408bf..df0f7e66d228 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_job_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_get_patch_job_sync.py @@ -39,7 +39,7 @@ def sample_get_patch_job(): # Make the request response = client.get_patch_job(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_GetPatchJob_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_async.py index 87e57e4b561e..94430f8baed5 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_async.py @@ -38,6 +38,8 @@ async def sample_list_patch_deployments(): # Make the request page_result = client.list_patch_deployments(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_sync.py index bc876e633b8f..6f86624c28f0 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_sync.py @@ -38,6 +38,8 @@ def sample_list_patch_deployments(): # Make the request page_result = client.list_patch_deployments(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_async.py index 017539fc908e..35b5bbfab127 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_async.py @@ -38,6 +38,8 @@ async def sample_list_patch_job_instance_details(): # Make the request page_result = client.list_patch_job_instance_details(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_sync.py index 471ce8cbbad6..3f3f843c7df0 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_sync.py @@ -38,6 +38,8 @@ def sample_list_patch_job_instance_details(): # Make the request page_result = client.list_patch_job_instance_details(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_async.py index 20fabff43940..7fa4f4632292 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_async.py @@ -38,6 +38,8 @@ async def sample_list_patch_jobs(): # Make the request page_result = client.list_patch_jobs(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_sync.py index 131572f0528f..27beded06604 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_sync.py @@ -38,6 +38,8 @@ def sample_list_patch_jobs(): # Make the request page_result = client.list_patch_jobs(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_async.py index 2345a2a88100..6f78ae6f0feb 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_async.py @@ -39,7 +39,7 @@ async def sample_pause_patch_deployment(): # Make the request response = await client.pause_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_PausePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_sync.py index 6ef0bc7141c5..42641de427e4 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_sync.py @@ -39,7 +39,7 @@ def sample_pause_patch_deployment(): # Make the request response = client.pause_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_PausePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_async.py index 151e20c6c8c6..af982bf2258f 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_async.py @@ -39,7 +39,7 @@ async def sample_resume_patch_deployment(): # Make the request response = await client.resume_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_ResumePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_sync.py index 9e29e6c36eeb..2a02160cc2ce 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_sync.py @@ -39,7 +39,7 @@ def sample_resume_patch_deployment(): # Make the request response = client.resume_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_ResumePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_async.py index ea765605c4fc..e155e369ff24 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_async.py @@ -38,7 +38,7 @@ async def sample_update_patch_deployment(): # Make the request response = await client.update_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_UpdatePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_sync.py index 85887a282b8d..2e1e7a783489 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_sync.py @@ -38,7 +38,7 @@ def sample_update_patch_deployment(): # Make the request response = client.update_patch_deployment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigService_UpdatePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_async.py index c891bff33c0e..bb1fcba220c4 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_async.py @@ -52,6 +52,8 @@ async def sample_create_os_policy_assignment(): print("Waiting for operation to complete...") response = await operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_CreateOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_sync.py index f2fb45a5671b..71f441b702b4 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_sync.py @@ -52,6 +52,8 @@ def sample_create_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_CreateOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_async.py index 37eb8b1201d6..22fccfeb7ad1 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_async.py @@ -42,6 +42,8 @@ async def sample_delete_os_policy_assignment(): print("Waiting for operation to complete...") response = await operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_DeleteOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_sync.py index bb5078fae364..ce8751decf0a 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_sync.py @@ -42,6 +42,8 @@ def sample_delete_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_DeleteOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_async.py index 0a7511cd69ad..f223db48853c 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_async.py @@ -39,7 +39,7 @@ async def sample_get_inventory(): # Make the request response = await client.get_inventory(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_GetInventory_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_sync.py index e3391988df39..db58a57b2456 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_sync.py @@ -39,7 +39,7 @@ def sample_get_inventory(): # Make the request response = client.get_inventory(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_GetInventory_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_async.py index acc46b8f3356..431c33880f99 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_async.py @@ -39,7 +39,7 @@ async def sample_get_os_policy_assignment(): # Make the request response = await client.get_os_policy_assignment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_GetOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_async.py index 2306233c089c..2312ac87de7b 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_async.py @@ -39,7 +39,7 @@ async def sample_get_os_policy_assignment_report(): # Make the request response = await client.get_os_policy_assignment_report(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_GetOSPolicyAssignmentReport_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_sync.py index 77dd01ef6d86..ca65598e89ad 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_sync.py @@ -39,7 +39,7 @@ def sample_get_os_policy_assignment_report(): # Make the request response = client.get_os_policy_assignment_report(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_sync.py index 00d417b6b09c..2c7ad0fbbeca 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_sync.py @@ -39,7 +39,7 @@ def sample_get_os_policy_assignment(): # Make the request response = client.get_os_policy_assignment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_GetOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_async.py index 5aecfc5323c2..08a5a6e3cec1 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_async.py @@ -39,7 +39,7 @@ async def sample_get_vulnerability_report(): # Make the request response = await client.get_vulnerability_report(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_GetVulnerabilityReport_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_sync.py index aeeb0abf261d..5df43b3639b9 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_sync.py @@ -39,7 +39,7 @@ def sample_get_vulnerability_report(): # Make the request response = client.get_vulnerability_report(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_GetVulnerabilityReport_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_async.py index 5d441e0bb041..803606818733 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_async.py @@ -38,6 +38,8 @@ async def sample_list_inventories(): # Make the request page_result = client.list_inventories(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_sync.py index 557d70ce3bd4..18808b5a4687 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_sync.py @@ -38,6 +38,8 @@ def sample_list_inventories(): # Make the request page_result = client.list_inventories(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_async.py index 5ba9213abb86..d889f81f39b4 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_async.py @@ -38,6 +38,8 @@ async def sample_list_os_policy_assignment_reports(): # Make the request page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_sync.py index 1d0824b02922..fd0e107c9e8c 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_sync.py @@ -38,6 +38,8 @@ def sample_list_os_policy_assignment_reports(): # Make the request page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_async.py index 2b6baf7230d4..77beb5bff80c 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_async.py @@ -38,6 +38,8 @@ async def sample_list_os_policy_assignment_revisions(): # Make the request page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py index a1ffd1944653..132348275e23 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py @@ -38,6 +38,8 @@ def sample_list_os_policy_assignment_revisions(): # Make the request page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_async.py index 6bb157e75599..cd7375af41c5 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_async.py @@ -38,6 +38,8 @@ async def sample_list_os_policy_assignments(): # Make the request page_result = client.list_os_policy_assignments(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_sync.py index 1ff3986290e0..67bf3d08aa71 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_sync.py @@ -38,6 +38,8 @@ def sample_list_os_policy_assignments(): # Make the request page_result = client.list_os_policy_assignments(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_async.py index dff1e50bda11..377ba368c8c4 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_async.py @@ -38,6 +38,8 @@ async def sample_list_vulnerability_reports(): # Make the request page_result = client.list_vulnerability_reports(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_sync.py index 6b5aafe436ed..9330bdea1e83 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_sync.py @@ -38,6 +38,8 @@ def sample_list_vulnerability_reports(): # Make the request page_result = client.list_vulnerability_reports(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_async.py index eae09093e3bc..03db0ac3eb26 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_async.py @@ -50,6 +50,8 @@ async def sample_update_os_policy_assignment(): print("Waiting for operation to complete...") response = await operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_UpdateOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_sync.py index ba64339823c7..1b38d6cdb062 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_sync.py @@ -50,6 +50,8 @@ def sample_update_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1_OsConfigZonalService_UpdateOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_async.py index a24fd6b11d52..4acf06f34d38 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_async.py @@ -52,6 +52,8 @@ async def sample_create_os_policy_assignment(): print("Waiting for operation to complete...") response = await operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_CreateOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_sync.py index 7f3eada878e9..bcef93127e66 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_sync.py @@ -52,6 +52,8 @@ def sample_create_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_CreateOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_async.py index 6cf9d2c68996..f9d47843c3ac 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_async.py @@ -42,6 +42,8 @@ async def sample_delete_os_policy_assignment(): print("Waiting for operation to complete...") response = await operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_DeleteOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_sync.py index d5fc89cc131b..223b831cfc52 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_sync.py @@ -42,6 +42,8 @@ def sample_delete_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_DeleteOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_async.py index 32cca4375a26..1504faf633aa 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_async.py @@ -39,7 +39,7 @@ async def sample_get_instance_os_policies_compliance(): # Make the request response = await client.get_instance_os_policies_compliance(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_sync.py index d7ff3ab1a0f0..ffc9c88e4ad9 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_sync.py @@ -39,7 +39,7 @@ def sample_get_instance_os_policies_compliance(): # Make the request response = client.get_instance_os_policies_compliance(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetInstanceOSPoliciesCompliance_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_async.py index b708562556d2..8bfc8dec72a8 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_async.py @@ -39,7 +39,7 @@ async def sample_get_inventory(): # Make the request response = await client.get_inventory(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetInventory_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_sync.py index b9652e350582..74625e06e564 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_sync.py @@ -39,7 +39,7 @@ def sample_get_inventory(): # Make the request response = client.get_inventory(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetInventory_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_async.py index 90196263fcc2..4fbfe771f157 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_async.py @@ -39,7 +39,7 @@ async def sample_get_os_policy_assignment(): # Make the request response = await client.get_os_policy_assignment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_report_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_report_async.py new file mode 100644 index 000000000000..ca7110bc22bf --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_report_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignmentReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetOSPolicyAssignmentReport_async] +from google.cloud import osconfig_v1alpha + + +async def sample_get_os_policy_assignment_report(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetOSPolicyAssignmentReportRequest( + name="name_value", + ) + + # Make the request + response = await client.get_os_policy_assignment_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetOSPolicyAssignmentReport_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_report_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_report_sync.py new file mode 100644 index 000000000000..8ff206e1484d --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_report_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignmentReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] +from google.cloud import osconfig_v1alpha + + +def sample_get_os_policy_assignment_report(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetOSPolicyAssignmentReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_os_policy_assignment_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_sync.py index 12c53f9247e7..64ff54cd26be 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_sync.py @@ -39,7 +39,7 @@ def sample_get_os_policy_assignment(): # Make the request response = client.get_os_policy_assignment(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_async.py index 21286adb091f..af801a5b6d91 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_async.py @@ -39,7 +39,7 @@ async def sample_get_vulnerability_report(): # Make the request response = await client.get_vulnerability_report(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetVulnerabilityReport_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_sync.py index 9ef05afaae07..ec8d72d1b794 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_sync.py @@ -39,7 +39,7 @@ def sample_get_vulnerability_report(): # Make the request response = client.get_vulnerability_report(request=request) - # Handle response + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetVulnerabilityReport_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_async.py index 3cc5dfbc729f..9adbbdd0e187 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_async.py @@ -38,6 +38,8 @@ async def sample_list_instance_os_policies_compliances(): # Make the request page_result = client.list_instance_os_policies_compliances(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_sync.py index 140d93e90269..a94c68abafac 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_sync.py @@ -38,6 +38,8 @@ def sample_list_instance_os_policies_compliances(): # Make the request page_result = client.list_instance_os_policies_compliances(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_async.py index b8f3efd87f22..f761fe14de0e 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_async.py @@ -38,6 +38,8 @@ async def sample_list_inventories(): # Make the request page_result = client.list_inventories(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_sync.py index d311e09c2a94..8f9a1b552add 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_sync.py @@ -38,6 +38,8 @@ def sample_list_inventories(): # Make the request page_result = client.list_inventories(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_reports_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_reports_async.py new file mode 100644 index 000000000000..0d980db5d750 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_reports_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListOSPolicyAssignmentReports_async] +from google.cloud import osconfig_v1alpha + + +async def sample_list_os_policy_assignment_reports(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListOSPolicyAssignmentReports_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_reports_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_reports_sync.py new file mode 100644 index 000000000000..81fefbc7ab63 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_reports_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] +from google.cloud import osconfig_v1alpha + + +def sample_list_os_policy_assignment_reports(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_async.py index af417c63e4b8..9e10cff81d26 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_async.py @@ -38,6 +38,8 @@ async def sample_list_os_policy_assignment_revisions(): # Make the request page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py index 8708953cb9e3..bd6c1e6d0050 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py @@ -38,6 +38,8 @@ def sample_list_os_policy_assignment_revisions(): # Make the request page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_async.py index c9c86229bca3..b3d1519172e8 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_async.py @@ -38,6 +38,8 @@ async def sample_list_os_policy_assignments(): # Make the request page_result = client.list_os_policy_assignments(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_sync.py index 64ff8e31f9ae..e0cf7c4b242b 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_sync.py @@ -38,6 +38,8 @@ def sample_list_os_policy_assignments(): # Make the request page_result = client.list_os_policy_assignments(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_async.py index 3924c89cd4dd..31eb1e1b91ec 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_async.py @@ -38,6 +38,8 @@ async def sample_list_vulnerability_reports(): # Make the request page_result = client.list_vulnerability_reports(request=request) + + # Handle the response async for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_sync.py index 606c9e13ff49..932c2a25f3f7 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_sync.py @@ -38,6 +38,8 @@ def sample_list_vulnerability_reports(): # Make the request page_result = client.list_vulnerability_reports(request=request) + + # Handle the response for response in page_result: print(response) diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_async.py index 3a1a54768f64..e7c716e0222c 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_async.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_async.py @@ -50,6 +50,8 @@ async def sample_update_os_policy_assignment(): print("Waiting for operation to complete...") response = await operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_UpdateOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_sync.py index 7f8d756c2ee3..a8da8f5ff14b 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_sync.py +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_sync.py @@ -50,6 +50,8 @@ def sample_update_os_policy_assignment(): print("Waiting for operation to complete...") response = operation.result() + + # Handle the response print(response) # [END osconfig_generated_osconfig_v1alpha_OsConfigZonalService_UpdateOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_cancel_patch_job_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_cancel_patch_job_async.py new file mode 100644 index 000000000000..6071589d213d --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_cancel_patch_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelPatchJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_CancelPatchJob_async] +from google.cloud import osconfig_v1 + + +async def sample_cancel_patch_job(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.CancelPatchJobRequest( + name="name_value", + ) + + # Make the request + response = await client.cancel_patch_job(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_CancelPatchJob_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_cancel_patch_job_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_cancel_patch_job_sync.py new file mode 100644 index 000000000000..1619ed096f1c --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_cancel_patch_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelPatchJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_CancelPatchJob_sync] +from google.cloud import osconfig_v1 + + +def sample_cancel_patch_job(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.CancelPatchJobRequest( + name="name_value", + ) + + # Make the request + response = client.cancel_patch_job(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_CancelPatchJob_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_create_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_create_patch_deployment_async.py new file mode 100644 index 000000000000..d44929b5196c --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_create_patch_deployment_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreatePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_CreatePatchDeployment_async] +from google.cloud import osconfig_v1 + + +async def sample_create_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.CreatePatchDeploymentRequest( + parent="parent_value", + patch_deployment_id="patch_deployment_id_value", + ) + + # Make the request + response = await client.create_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_CreatePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_create_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_create_patch_deployment_sync.py new file mode 100644 index 000000000000..1ca737f2fa8d --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_create_patch_deployment_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreatePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_CreatePatchDeployment_sync] +from google.cloud import osconfig_v1 + + +def sample_create_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.CreatePatchDeploymentRequest( + parent="parent_value", + patch_deployment_id="patch_deployment_id_value", + ) + + # Make the request + response = client.create_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_CreatePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_delete_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_delete_patch_deployment_async.py new file mode 100644 index 000000000000..aa8bf0a7749e --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_delete_patch_deployment_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeletePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_DeletePatchDeployment_async] +from google.cloud import osconfig_v1 + + +async def sample_delete_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.DeletePatchDeploymentRequest( + name="name_value", + ) + + # Make the request + await client.delete_patch_deployment(request=request) + + +# [END osconfig_v1_generated_OsConfigService_DeletePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_delete_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_delete_patch_deployment_sync.py new file mode 100644 index 000000000000..313c9df5603f --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_delete_patch_deployment_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeletePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_DeletePatchDeployment_sync] +from google.cloud import osconfig_v1 + + +def sample_delete_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.DeletePatchDeploymentRequest( + name="name_value", + ) + + # Make the request + client.delete_patch_deployment(request=request) + + +# [END osconfig_v1_generated_OsConfigService_DeletePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_execute_patch_job_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_execute_patch_job_async.py new file mode 100644 index 000000000000..e94418ae424a --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_execute_patch_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExecutePatchJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ExecutePatchJob_async] +from google.cloud import osconfig_v1 + + +async def sample_execute_patch_job(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ExecutePatchJobRequest( + parent="parent_value", + ) + + # Make the request + response = await client.execute_patch_job(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_ExecutePatchJob_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_execute_patch_job_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_execute_patch_job_sync.py new file mode 100644 index 000000000000..925ef9864758 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_execute_patch_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExecutePatchJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ExecutePatchJob_sync] +from google.cloud import osconfig_v1 + + +def sample_execute_patch_job(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ExecutePatchJobRequest( + parent="parent_value", + ) + + # Make the request + response = client.execute_patch_job(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_ExecutePatchJob_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_deployment_async.py new file mode 100644 index 000000000000..cb9030a0d9ee --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_deployment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_GetPatchDeployment_async] +from google.cloud import osconfig_v1 + + +async def sample_get_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.GetPatchDeploymentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_GetPatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_deployment_sync.py new file mode 100644 index 000000000000..af729f7ace7c --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_deployment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_GetPatchDeployment_sync] +from google.cloud import osconfig_v1 + + +def sample_get_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.GetPatchDeploymentRequest( + name="name_value", + ) + + # Make the request + response = client.get_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_GetPatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_job_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_job_async.py new file mode 100644 index 000000000000..7c0a82942b1c --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_job_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPatchJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_GetPatchJob_async] +from google.cloud import osconfig_v1 + + +async def sample_get_patch_job(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.GetPatchJobRequest( + name="name_value", + ) + + # Make the request + response = await client.get_patch_job(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_GetPatchJob_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_job_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_job_sync.py new file mode 100644 index 000000000000..e96c41cc33f6 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_get_patch_job_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPatchJob +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_GetPatchJob_sync] +from google.cloud import osconfig_v1 + + +def sample_get_patch_job(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.GetPatchJobRequest( + name="name_value", + ) + + # Make the request + response = client.get_patch_job(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_GetPatchJob_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_deployments_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_deployments_async.py new file mode 100644 index 000000000000..4b2a496fc71d --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_deployments_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPatchDeployments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ListPatchDeployments_async] +from google.cloud import osconfig_v1 + + +async def sample_list_patch_deployments(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ListPatchDeploymentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_patch_deployments(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigService_ListPatchDeployments_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_deployments_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_deployments_sync.py new file mode 100644 index 000000000000..499f20c9f101 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_deployments_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPatchDeployments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ListPatchDeployments_sync] +from google.cloud import osconfig_v1 + + +def sample_list_patch_deployments(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ListPatchDeploymentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_patch_deployments(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigService_ListPatchDeployments_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_job_instance_details_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_job_instance_details_async.py new file mode 100644 index 000000000000..6e47e4372bb1 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_job_instance_details_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPatchJobInstanceDetails +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_async] +from google.cloud import osconfig_v1 + + +async def sample_list_patch_job_instance_details(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ListPatchJobInstanceDetailsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_patch_job_instance_details(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_job_instance_details_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_job_instance_details_sync.py new file mode 100644 index 000000000000..25f4e00b1adb --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_job_instance_details_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPatchJobInstanceDetails +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_sync] +from google.cloud import osconfig_v1 + + +def sample_list_patch_job_instance_details(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ListPatchJobInstanceDetailsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_patch_job_instance_details(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_jobs_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_jobs_async.py new file mode 100644 index 000000000000..fe05fdd35f94 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_jobs_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPatchJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ListPatchJobs_async] +from google.cloud import osconfig_v1 + + +async def sample_list_patch_jobs(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ListPatchJobsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_patch_jobs(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigService_ListPatchJobs_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_jobs_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_jobs_sync.py new file mode 100644 index 000000000000..22c8ec71c656 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_list_patch_jobs_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPatchJobs +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ListPatchJobs_sync] +from google.cloud import osconfig_v1 + + +def sample_list_patch_jobs(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ListPatchJobsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_patch_jobs(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigService_ListPatchJobs_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_pause_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_pause_patch_deployment_async.py new file mode 100644 index 000000000000..51a2586416be --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_pause_patch_deployment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PausePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_PausePatchDeployment_async] +from google.cloud import osconfig_v1 + + +async def sample_pause_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.PausePatchDeploymentRequest( + name="name_value", + ) + + # Make the request + response = await client.pause_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_PausePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_pause_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_pause_patch_deployment_sync.py new file mode 100644 index 000000000000..1abf24e633c7 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_pause_patch_deployment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PausePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_PausePatchDeployment_sync] +from google.cloud import osconfig_v1 + + +def sample_pause_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.PausePatchDeploymentRequest( + name="name_value", + ) + + # Make the request + response = client.pause_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_PausePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_resume_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_resume_patch_deployment_async.py new file mode 100644 index 000000000000..98a2bd183e51 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_resume_patch_deployment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ResumePatchDeployment_async] +from google.cloud import osconfig_v1 + + +async def sample_resume_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ResumePatchDeploymentRequest( + name="name_value", + ) + + # Make the request + response = await client.resume_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_ResumePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_resume_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_resume_patch_deployment_sync.py new file mode 100644 index 000000000000..31dd30b03d2a --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_resume_patch_deployment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_ResumePatchDeployment_sync] +from google.cloud import osconfig_v1 + + +def sample_resume_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ResumePatchDeploymentRequest( + name="name_value", + ) + + # Make the request + response = client.resume_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_ResumePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_update_patch_deployment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_update_patch_deployment_async.py new file mode 100644 index 000000000000..00c7899319a2 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_update_patch_deployment_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdatePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_async] +from google.cloud import osconfig_v1 + + +async def sample_update_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.UpdatePatchDeploymentRequest( + ) + + # Make the request + response = await client.update_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_update_patch_deployment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_update_patch_deployment_sync.py new file mode 100644 index 000000000000..bcf4f71491b9 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_service_update_patch_deployment_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdatePatchDeployment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_sync] +from google.cloud import osconfig_v1 + + +def sample_update_patch_deployment(): + # Create a client + client = osconfig_v1.OsConfigServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.UpdatePatchDeploymentRequest( + ) + + # Make the request + response = client.update_patch_deployment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.py new file mode 100644 index 000000000000..76117efefe90 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_async] +from google.cloud import osconfig_v1 + + +async def sample_create_os_policy_assignment(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + os_policy_assignment = osconfig_v1.OSPolicyAssignment() + os_policy_assignment.os_policies.id = "id_value" + os_policy_assignment.os_policies.mode = "ENFORCEMENT" + os_policy_assignment.os_policies.resource_groups.resources.pkg.apt.name = "name_value" + os_policy_assignment.os_policies.resource_groups.resources.pkg.desired_state = "REMOVED" + os_policy_assignment.os_policies.resource_groups.resources.id = "id_value" + os_policy_assignment.rollout.disruption_budget.fixed = 528 + + request = osconfig_v1.CreateOSPolicyAssignmentRequest( + parent="parent_value", + os_policy_assignment=os_policy_assignment, + os_policy_assignment_id="os_policy_assignment_id_value", + ) + + # Make the request + operation = client.create_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_sync.py new file mode 100644 index 000000000000..3493d0d36772 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync] +from google.cloud import osconfig_v1 + + +def sample_create_os_policy_assignment(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + os_policy_assignment = osconfig_v1.OSPolicyAssignment() + os_policy_assignment.os_policies.id = "id_value" + os_policy_assignment.os_policies.mode = "ENFORCEMENT" + os_policy_assignment.os_policies.resource_groups.resources.pkg.apt.name = "name_value" + os_policy_assignment.os_policies.resource_groups.resources.pkg.desired_state = "REMOVED" + os_policy_assignment.os_policies.resource_groups.resources.id = "id_value" + os_policy_assignment.rollout.disruption_budget.fixed = 528 + + request = osconfig_v1.CreateOSPolicyAssignmentRequest( + parent="parent_value", + os_policy_assignment=os_policy_assignment, + os_policy_assignment_id="os_policy_assignment_id_value", + ) + + # Make the request + operation = client.create_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.py new file mode 100644 index 000000000000..00d9b4d4b5d6 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async] +from google.cloud import osconfig_v1 + + +async def sample_delete_os_policy_assignment(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.DeleteOSPolicyAssignmentRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py new file mode 100644 index 000000000000..756b5f00b063 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync] +from google.cloud import osconfig_v1 + + +def sample_delete_os_policy_assignment(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.DeleteOSPolicyAssignmentRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_inventory_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_inventory_async.py new file mode 100644 index 000000000000..38bb3e3c63ae --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_inventory_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetInventory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_GetInventory_async] +from google.cloud import osconfig_v1 + + +async def sample_get_inventory(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.GetInventoryRequest( + name="name_value", + ) + + # Make the request + response = await client.get_inventory(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_GetInventory_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_inventory_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_inventory_sync.py new file mode 100644 index 000000000000..7cf5c919bdb4 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_inventory_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetInventory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_GetInventory_sync] +from google.cloud import osconfig_v1 + + +def sample_get_inventory(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.GetInventoryRequest( + name="name_value", + ) + + # Make the request + response = client.get_inventory(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_GetInventory_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_async.py new file mode 100644 index 000000000000..ac6b696a5f39 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_async] +from google.cloud import osconfig_v1 + + +async def sample_get_os_policy_assignment(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.GetOSPolicyAssignmentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_os_policy_assignment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py new file mode 100644 index 000000000000..44002eeebe7e --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignmentReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async] +from google.cloud import osconfig_v1 + + +async def sample_get_os_policy_assignment_report(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.GetOSPolicyAssignmentReportRequest( + name="name_value", + ) + + # Make the request + response = await client.get_os_policy_assignment_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py new file mode 100644 index 000000000000..b0a702af5ddf --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignmentReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] +from google.cloud import osconfig_v1 + + +def sample_get_os_policy_assignment_report(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.GetOSPolicyAssignmentReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_os_policy_assignment_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_sync.py new file mode 100644 index 000000000000..59ed383f73b7 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_sync] +from google.cloud import osconfig_v1 + + +def sample_get_os_policy_assignment(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.GetOSPolicyAssignmentRequest( + name="name_value", + ) + + # Make the request + response = client.get_os_policy_assignment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_async.py new file mode 100644 index 000000000000..d58d6dd87ecb --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetVulnerabilityReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_async] +from google.cloud import osconfig_v1 + + +async def sample_get_vulnerability_report(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.GetVulnerabilityReportRequest( + name="name_value", + ) + + # Make the request + response = await client.get_vulnerability_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_sync.py new file mode 100644 index 000000000000..d286362f7a1d --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetVulnerabilityReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_sync] +from google.cloud import osconfig_v1 + + +def sample_get_vulnerability_report(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.GetVulnerabilityReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_vulnerability_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_inventories_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_inventories_async.py new file mode 100644 index 000000000000..c7e325348a5b --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_inventories_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListInventories +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListInventories_async] +from google.cloud import osconfig_v1 + + +async def sample_list_inventories(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ListInventoriesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_inventories(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListInventories_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_inventories_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_inventories_sync.py new file mode 100644 index 000000000000..98a6426e0edb --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_inventories_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListInventories +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListInventories_sync] +from google.cloud import osconfig_v1 + + +def sample_list_inventories(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ListInventoriesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_inventories(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListInventories_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py new file mode 100644 index 000000000000..312a72160e33 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async] +from google.cloud import osconfig_v1 + + +async def sample_list_os_policy_assignment_reports(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ListOSPolicyAssignmentReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py new file mode 100644 index 000000000000..a50bb7fe5692 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] +from google.cloud import osconfig_v1 + + +def sample_list_os_policy_assignment_reports(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ListOSPolicyAssignmentReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py new file mode 100644 index 000000000000..ea6cdcf1d1f3 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentRevisions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async] +from google.cloud import osconfig_v1 + + +async def sample_list_os_policy_assignment_revisions(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ListOSPolicyAssignmentRevisionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py new file mode 100644 index 000000000000..e9157263e287 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentRevisions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync] +from google.cloud import osconfig_v1 + + +def sample_list_os_policy_assignment_revisions(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ListOSPolicyAssignmentRevisionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_async.py new file mode 100644 index 000000000000..e98adeb50f55 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_async] +from google.cloud import osconfig_v1 + + +async def sample_list_os_policy_assignments(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ListOSPolicyAssignmentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignments(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_sync.py new file mode 100644 index 000000000000..bda0e60f2ba6 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_sync] +from google.cloud import osconfig_v1 + + +def sample_list_os_policy_assignments(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ListOSPolicyAssignmentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignments(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_async.py new file mode 100644 index 000000000000..ec68a65eb9a8 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListVulnerabilityReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_async] +from google.cloud import osconfig_v1 + + +async def sample_list_vulnerability_reports(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1.ListVulnerabilityReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_vulnerability_reports(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_sync.py new file mode 100644 index 000000000000..b8ab11636df4 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListVulnerabilityReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_sync] +from google.cloud import osconfig_v1 + + +def sample_list_vulnerability_reports(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1.ListVulnerabilityReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_vulnerability_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.py new file mode 100644 index 000000000000..ff47e82517f3 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async] +from google.cloud import osconfig_v1 + + +async def sample_update_os_policy_assignment(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + os_policy_assignment = osconfig_v1.OSPolicyAssignment() + os_policy_assignment.os_policies.id = "id_value" + os_policy_assignment.os_policies.mode = "ENFORCEMENT" + os_policy_assignment.os_policies.resource_groups.resources.pkg.apt.name = "name_value" + os_policy_assignment.os_policies.resource_groups.resources.pkg.desired_state = "REMOVED" + os_policy_assignment.os_policies.resource_groups.resources.id = "id_value" + os_policy_assignment.rollout.disruption_budget.fixed = 528 + + request = osconfig_v1.UpdateOSPolicyAssignmentRequest( + os_policy_assignment=os_policy_assignment, + ) + + # Make the request + operation = client.update_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_sync.py new file mode 100644 index 000000000000..0a4cbcc5914a --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_sync.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync] +from google.cloud import osconfig_v1 + + +def sample_update_os_policy_assignment(): + # Create a client + client = osconfig_v1.OsConfigZonalServiceClient() + + # Initialize request argument(s) + os_policy_assignment = osconfig_v1.OSPolicyAssignment() + os_policy_assignment.os_policies.id = "id_value" + os_policy_assignment.os_policies.mode = "ENFORCEMENT" + os_policy_assignment.os_policies.resource_groups.resources.pkg.apt.name = "name_value" + os_policy_assignment.os_policies.resource_groups.resources.pkg.desired_state = "REMOVED" + os_policy_assignment.os_policies.resource_groups.resources.id = "id_value" + os_policy_assignment.rollout.disruption_budget.fixed = 528 + + request = osconfig_v1.UpdateOSPolicyAssignmentRequest( + os_policy_assignment=os_policy_assignment, + ) + + # Make the request + operation = client.update_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.py new file mode 100644 index 000000000000..cbde2fe8a6ab --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_async] +from google.cloud import osconfig_v1alpha + + +async def sample_create_os_policy_assignment(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + os_policy_assignment = osconfig_v1alpha.OSPolicyAssignment() + os_policy_assignment.os_policies.id = "id_value" + os_policy_assignment.os_policies.mode = "ENFORCEMENT" + os_policy_assignment.os_policies.resource_groups.resources.pkg.apt.name = "name_value" + os_policy_assignment.os_policies.resource_groups.resources.pkg.desired_state = "REMOVED" + os_policy_assignment.os_policies.resource_groups.resources.id = "id_value" + os_policy_assignment.rollout.disruption_budget.fixed = 528 + + request = osconfig_v1alpha.CreateOSPolicyAssignmentRequest( + parent="parent_value", + os_policy_assignment=os_policy_assignment, + os_policy_assignment_id="os_policy_assignment_id_value", + ) + + # Make the request + operation = client.create_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_sync.py new file mode 100644 index 000000000000..40cbdedd301d --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync] +from google.cloud import osconfig_v1alpha + + +def sample_create_os_policy_assignment(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + os_policy_assignment = osconfig_v1alpha.OSPolicyAssignment() + os_policy_assignment.os_policies.id = "id_value" + os_policy_assignment.os_policies.mode = "ENFORCEMENT" + os_policy_assignment.os_policies.resource_groups.resources.pkg.apt.name = "name_value" + os_policy_assignment.os_policies.resource_groups.resources.pkg.desired_state = "REMOVED" + os_policy_assignment.os_policies.resource_groups.resources.id = "id_value" + os_policy_assignment.rollout.disruption_budget.fixed = 528 + + request = osconfig_v1alpha.CreateOSPolicyAssignmentRequest( + parent="parent_value", + os_policy_assignment=os_policy_assignment, + os_policy_assignment_id="os_policy_assignment_id_value", + ) + + # Make the request + operation = client.create_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.py new file mode 100644 index 000000000000..a005a8b7bbd4 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async] +from google.cloud import osconfig_v1alpha + + +async def sample_delete_os_policy_assignment(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.DeleteOSPolicyAssignmentRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py new file mode 100644 index 000000000000..55c64a4c3518 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync] +from google.cloud import osconfig_v1alpha + + +def sample_delete_os_policy_assignment(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.DeleteOSPolicyAssignmentRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_async.py new file mode 100644 index 000000000000..1a29bd17581c --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetInstanceOSPoliciesCompliance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async] +from google.cloud import osconfig_v1alpha + + +async def sample_get_instance_os_policies_compliance(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetInstanceOSPoliciesComplianceRequest( + name="name_value", + ) + + # Make the request + response = await client.get_instance_os_policies_compliance(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_sync.py new file mode 100644 index 000000000000..76bb7e133698 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetInstanceOSPoliciesCompliance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_sync] +from google.cloud import osconfig_v1alpha + + +def sample_get_instance_os_policies_compliance(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetInstanceOSPoliciesComplianceRequest( + name="name_value", + ) + + # Make the request + response = client.get_instance_os_policies_compliance(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_async.py new file mode 100644 index 000000000000..5a1d4f5f7153 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetInventory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_async] +from google.cloud import osconfig_v1alpha + + +async def sample_get_inventory(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetInventoryRequest( + name="name_value", + ) + + # Make the request + response = await client.get_inventory(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_sync.py new file mode 100644 index 000000000000..19eb03d37ab6 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetInventory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_sync] +from google.cloud import osconfig_v1alpha + + +def sample_get_inventory(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetInventoryRequest( + name="name_value", + ) + + # Make the request + response = client.get_inventory(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_async.py new file mode 100644 index 000000000000..e9794b3e6515 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_async] +from google.cloud import osconfig_v1alpha + + +async def sample_get_os_policy_assignment(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetOSPolicyAssignmentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_os_policy_assignment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py new file mode 100644 index 000000000000..1d379eeb27f9 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignmentReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async] +from google.cloud import osconfig_v1alpha + + +async def sample_get_os_policy_assignment_report(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetOSPolicyAssignmentReportRequest( + name="name_value", + ) + + # Make the request + response = await client.get_os_policy_assignment_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py new file mode 100644 index 000000000000..982aced788d8 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignmentReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] +from google.cloud import osconfig_v1alpha + + +def sample_get_os_policy_assignment_report(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetOSPolicyAssignmentReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_os_policy_assignment_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_sync.py new file mode 100644 index 000000000000..cc6d4a46c554 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_sync] +from google.cloud import osconfig_v1alpha + + +def sample_get_os_policy_assignment(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetOSPolicyAssignmentRequest( + name="name_value", + ) + + # Make the request + response = client.get_os_policy_assignment(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_async.py new file mode 100644 index 000000000000..521c77ced662 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetVulnerabilityReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_async] +from google.cloud import osconfig_v1alpha + + +async def sample_get_vulnerability_report(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetVulnerabilityReportRequest( + name="name_value", + ) + + # Make the request + response = await client.get_vulnerability_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_sync.py new file mode 100644 index 000000000000..db53bdfa9300 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetVulnerabilityReport +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_sync] +from google.cloud import osconfig_v1alpha + + +def sample_get_vulnerability_report(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.GetVulnerabilityReportRequest( + name="name_value", + ) + + # Make the request + response = client.get_vulnerability_report(request=request) + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_async.py new file mode 100644 index 000000000000..394ad17098a4 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListInstanceOSPoliciesCompliances +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_async] +from google.cloud import osconfig_v1alpha + + +async def sample_list_instance_os_policies_compliances(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListInstanceOSPoliciesCompliancesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_instance_os_policies_compliances(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_sync.py new file mode 100644 index 000000000000..caaa6221a134 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListInstanceOSPoliciesCompliances +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_sync] +from google.cloud import osconfig_v1alpha + + +def sample_list_instance_os_policies_compliances(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListInstanceOSPoliciesCompliancesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_instance_os_policies_compliances(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_async.py new file mode 100644 index 000000000000..a27c1fccd385 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListInventories +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_async] +from google.cloud import osconfig_v1alpha + + +async def sample_list_inventories(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListInventoriesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_inventories(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_sync.py new file mode 100644 index 000000000000..00214ae4cb98 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListInventories +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_sync] +from google.cloud import osconfig_v1alpha + + +def sample_list_inventories(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListInventoriesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_inventories(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py new file mode 100644 index 000000000000..1fcf7517a81a --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async] +from google.cloud import osconfig_v1alpha + + +async def sample_list_os_policy_assignment_reports(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py new file mode 100644 index 000000000000..5d0baf7ec067 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] +from google.cloud import osconfig_v1alpha + + +def sample_list_os_policy_assignment_reports(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py new file mode 100644 index 000000000000..3657aa3acce8 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentRevisions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async] +from google.cloud import osconfig_v1alpha + + +async def sample_list_os_policy_assignment_revisions(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentRevisionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py new file mode 100644 index 000000000000..404689526911 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignmentRevisions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync] +from google.cloud import osconfig_v1alpha + + +def sample_list_os_policy_assignment_revisions(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentRevisionsRequest( + name="name_value", + ) + + # Make the request + page_result = client.list_os_policy_assignment_revisions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_async.py new file mode 100644 index 000000000000..2abe950b4f3c --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_async] +from google.cloud import osconfig_v1alpha + + +async def sample_list_os_policy_assignments(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignments(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_sync.py new file mode 100644 index 000000000000..3131ee47becf --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOSPolicyAssignments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_sync] +from google.cloud import osconfig_v1alpha + + +def sample_list_os_policy_assignments(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListOSPolicyAssignmentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_os_policy_assignments(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_async.py new file mode 100644 index 000000000000..256e7108326f --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListVulnerabilityReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_async] +from google.cloud import osconfig_v1alpha + + +async def sample_list_vulnerability_reports(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListVulnerabilityReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_vulnerability_reports(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_sync.py new file mode 100644 index 000000000000..7e5a5195acf2 --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListVulnerabilityReports +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_sync] +from google.cloud import osconfig_v1alpha + + +def sample_list_vulnerability_reports(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + request = osconfig_v1alpha.ListVulnerabilityReportsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_vulnerability_reports(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.py new file mode 100644 index 000000000000..cf31dcf70f7a --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async] +from google.cloud import osconfig_v1alpha + + +async def sample_update_os_policy_assignment(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceAsyncClient() + + # Initialize request argument(s) + os_policy_assignment = osconfig_v1alpha.OSPolicyAssignment() + os_policy_assignment.os_policies.id = "id_value" + os_policy_assignment.os_policies.mode = "ENFORCEMENT" + os_policy_assignment.os_policies.resource_groups.resources.pkg.apt.name = "name_value" + os_policy_assignment.os_policies.resource_groups.resources.pkg.desired_state = "REMOVED" + os_policy_assignment.os_policies.resource_groups.resources.id = "id_value" + os_policy_assignment.rollout.disruption_budget.fixed = 528 + + request = osconfig_v1alpha.UpdateOSPolicyAssignmentRequest( + os_policy_assignment=os_policy_assignment, + ) + + # Make the request + operation = client.update_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async] diff --git a/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_sync.py b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_sync.py new file mode 100644 index 000000000000..841dc1830cdd --- /dev/null +++ b/packages/google-cloud-os-config/samples/generated_samples/osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_sync.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateOSPolicyAssignment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-os-config + + +# [START osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync] +from google.cloud import osconfig_v1alpha + + +def sample_update_os_policy_assignment(): + # Create a client + client = osconfig_v1alpha.OsConfigZonalServiceClient() + + # Initialize request argument(s) + os_policy_assignment = osconfig_v1alpha.OSPolicyAssignment() + os_policy_assignment.os_policies.id = "id_value" + os_policy_assignment.os_policies.mode = "ENFORCEMENT" + os_policy_assignment.os_policies.resource_groups.resources.pkg.apt.name = "name_value" + os_policy_assignment.os_policies.resource_groups.resources.pkg.desired_state = "REMOVED" + os_policy_assignment.os_policies.resource_groups.resources.id = "id_value" + os_policy_assignment.rollout.disruption_budget.fixed = 528 + + request = osconfig_v1alpha.UpdateOSPolicyAssignmentRequest( + os_policy_assignment=os_policy_assignment, + ) + + # Make the request + operation = client.update_os_policy_assignment(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync] diff --git a/packages/google-cloud-os-config/samples/generated_samples/snippet_metadata_osconfig_v1.json b/packages/google-cloud-os-config/samples/generated_samples/snippet_metadata_osconfig_v1.json index 7be2a9d58013..e221770bacdb 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/snippet_metadata_osconfig_v1.json +++ b/packages/google-cloud-os-config/samples/generated_samples/snippet_metadata_osconfig_v1.json @@ -10,8 +10,8 @@ "shortName": "CancelPatchJob" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_CancelPatchJob_async", + "file": "osconfig_v1_generated_os_config_service_cancel_patch_job_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_CancelPatchJob_async", "segments": [ { "end": 44, @@ -54,8 +54,8 @@ "shortName": "CancelPatchJob" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_cancel_patch_job_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_CancelPatchJob_sync", + "file": "osconfig_v1_generated_os_config_service_cancel_patch_job_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_CancelPatchJob_sync", "segments": [ { "end": 44, @@ -99,8 +99,8 @@ "shortName": "CreatePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_CreatePatchDeployment_async", + "file": "osconfig_v1_generated_os_config_service_create_patch_deployment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_CreatePatchDeployment_async", "segments": [ { "end": 45, @@ -143,8 +143,8 @@ "shortName": "CreatePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_create_patch_deployment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_CreatePatchDeployment_sync", + "file": "osconfig_v1_generated_os_config_service_create_patch_deployment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_CreatePatchDeployment_sync", "segments": [ { "end": 45, @@ -188,8 +188,8 @@ "shortName": "DeletePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_DeletePatchDeployment_async", + "file": "osconfig_v1_generated_os_config_service_delete_patch_deployment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_DeletePatchDeployment_async", "segments": [ { "end": 42, @@ -230,8 +230,8 @@ "shortName": "DeletePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_delete_patch_deployment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_DeletePatchDeployment_sync", + "file": "osconfig_v1_generated_os_config_service_delete_patch_deployment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_DeletePatchDeployment_sync", "segments": [ { "end": 42, @@ -273,8 +273,8 @@ "shortName": "ExecutePatchJob" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ExecutePatchJob_async", + "file": "osconfig_v1_generated_os_config_service_execute_patch_job_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ExecutePatchJob_async", "segments": [ { "end": 44, @@ -317,8 +317,8 @@ "shortName": "ExecutePatchJob" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_execute_patch_job_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ExecutePatchJob_sync", + "file": "osconfig_v1_generated_os_config_service_execute_patch_job_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ExecutePatchJob_sync", "segments": [ { "end": 44, @@ -362,8 +362,8 @@ "shortName": "GetPatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_GetPatchDeployment_async", + "file": "osconfig_v1_generated_os_config_service_get_patch_deployment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_GetPatchDeployment_async", "segments": [ { "end": 44, @@ -406,8 +406,8 @@ "shortName": "GetPatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_get_patch_deployment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_GetPatchDeployment_sync", + "file": "osconfig_v1_generated_os_config_service_get_patch_deployment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_GetPatchDeployment_sync", "segments": [ { "end": 44, @@ -451,8 +451,8 @@ "shortName": "GetPatchJob" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_get_patch_job_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_GetPatchJob_async", + "file": "osconfig_v1_generated_os_config_service_get_patch_job_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_GetPatchJob_async", "segments": [ { "end": 44, @@ -495,8 +495,8 @@ "shortName": "GetPatchJob" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_get_patch_job_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_GetPatchJob_sync", + "file": "osconfig_v1_generated_os_config_service_get_patch_job_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_GetPatchJob_sync", "segments": [ { "end": 44, @@ -540,16 +540,16 @@ "shortName": "ListPatchDeployments" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ListPatchDeployments_async", + "file": "osconfig_v1_generated_os_config_service_list_patch_deployments_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchDeployments_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -564,11 +564,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -582,16 +584,16 @@ "shortName": "ListPatchDeployments" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_list_patch_deployments_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ListPatchDeployments_sync", + "file": "osconfig_v1_generated_os_config_service_list_patch_deployments_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchDeployments_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -606,11 +608,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -625,16 +629,16 @@ "shortName": "ListPatchJobInstanceDetails" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ListPatchJobInstanceDetails_async", + "file": "osconfig_v1_generated_os_config_service_list_patch_job_instance_details_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -649,11 +653,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -667,16 +673,16 @@ "shortName": "ListPatchJobInstanceDetails" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_list_patch_job_instance_details_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ListPatchJobInstanceDetails_sync", + "file": "osconfig_v1_generated_os_config_service_list_patch_job_instance_details_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -691,11 +697,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -710,16 +718,16 @@ "shortName": "ListPatchJobs" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ListPatchJobs_async", + "file": "osconfig_v1_generated_os_config_service_list_patch_jobs_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchJobs_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -734,11 +742,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -752,16 +762,16 @@ "shortName": "ListPatchJobs" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_list_patch_jobs_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ListPatchJobs_sync", + "file": "osconfig_v1_generated_os_config_service_list_patch_jobs_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ListPatchJobs_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -776,11 +786,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -795,8 +807,8 @@ "shortName": "PausePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_PausePatchDeployment_async", + "file": "osconfig_v1_generated_os_config_service_pause_patch_deployment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_PausePatchDeployment_async", "segments": [ { "end": 44, @@ -839,8 +851,8 @@ "shortName": "PausePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_pause_patch_deployment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_PausePatchDeployment_sync", + "file": "osconfig_v1_generated_os_config_service_pause_patch_deployment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_PausePatchDeployment_sync", "segments": [ { "end": 44, @@ -884,8 +896,8 @@ "shortName": "ResumePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ResumePatchDeployment_async", + "file": "osconfig_v1_generated_os_config_service_resume_patch_deployment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ResumePatchDeployment_async", "segments": [ { "end": 44, @@ -928,8 +940,8 @@ "shortName": "ResumePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_resume_patch_deployment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_ResumePatchDeployment_sync", + "file": "osconfig_v1_generated_os_config_service_resume_patch_deployment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_ResumePatchDeployment_sync", "segments": [ { "end": 44, @@ -973,8 +985,8 @@ "shortName": "UpdatePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_UpdatePatchDeployment_async", + "file": "osconfig_v1_generated_os_config_service_update_patch_deployment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_async", "segments": [ { "end": 43, @@ -1017,8 +1029,8 @@ "shortName": "UpdatePatchDeployment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_service_update_patch_deployment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigService_UpdatePatchDeployment_sync", + "file": "osconfig_v1_generated_os_config_service_update_patch_deployment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_sync", "segments": [ { "end": 43, @@ -1062,16 +1074,16 @@ "shortName": "CreateOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_CreateOSPolicyAssignment_async", + "file": "osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_async", "segments": [ { - "end": 56, + "end": 58, "start": 27, "type": "FULL" }, { - "end": 56, + "end": 58, "start": 27, "type": "SHORT" }, @@ -1086,11 +1098,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 55, "start": 49, "type": "REQUEST_EXECUTION" }, { - "end": 57, + "end": 59, + "start": 56, "type": "RESPONSE_HANDLING" } ] @@ -1104,16 +1118,16 @@ "shortName": "CreateOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_create_os_policy_assignment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_CreateOSPolicyAssignment_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_create_os_policy_assignment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync", "segments": [ { - "end": 56, + "end": 58, "start": 27, "type": "FULL" }, { - "end": 56, + "end": 58, "start": 27, "type": "SHORT" }, @@ -1128,11 +1142,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 55, "start": 49, "type": "REQUEST_EXECUTION" }, { - "end": 57, + "end": 59, + "start": 56, "type": "RESPONSE_HANDLING" } ] @@ -1147,16 +1163,16 @@ "shortName": "DeleteOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_DeleteOSPolicyAssignment_async", + "file": "osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async", "segments": [ { - "end": 46, + "end": 48, "start": 27, "type": "FULL" }, { - "end": 46, + "end": 48, "start": 27, "type": "SHORT" }, @@ -1171,11 +1187,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 45, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 47, + "end": 49, + "start": 46, "type": "RESPONSE_HANDLING" } ] @@ -1189,16 +1207,16 @@ "shortName": "DeleteOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_delete_os_policy_assignment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_DeleteOSPolicyAssignment_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync", "segments": [ { - "end": 46, + "end": 48, "start": 27, "type": "FULL" }, { - "end": 46, + "end": 48, "start": 27, "type": "SHORT" }, @@ -1213,11 +1231,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 45, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 47, + "end": 49, + "start": 46, "type": "RESPONSE_HANDLING" } ] @@ -1232,8 +1252,8 @@ "shortName": "GetInventory" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_GetInventory_async", + "file": "osconfig_v1_generated_os_config_zonal_service_get_inventory_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetInventory_async", "segments": [ { "end": 44, @@ -1276,8 +1296,8 @@ "shortName": "GetInventory" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_get_inventory_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_GetInventory_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_get_inventory_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetInventory_sync", "segments": [ { "end": 44, @@ -1321,8 +1341,8 @@ "shortName": "GetOSPolicyAssignmentReport" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_GetOSPolicyAssignmentReport_async", + "file": "osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async", "segments": [ { "end": 44, @@ -1365,8 +1385,8 @@ "shortName": "GetOSPolicyAssignmentReport" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_report_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_GetOSPolicyAssignmentReport_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync", "segments": [ { "end": 44, @@ -1410,8 +1430,8 @@ "shortName": "GetOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_GetOSPolicyAssignment_async", + "file": "osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_async", "segments": [ { "end": 44, @@ -1454,8 +1474,8 @@ "shortName": "GetOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_get_os_policy_assignment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_GetOSPolicyAssignment_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_get_os_policy_assignment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_sync", "segments": [ { "end": 44, @@ -1499,8 +1519,8 @@ "shortName": "GetVulnerabilityReport" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_GetVulnerabilityReport_async", + "file": "osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_async", "segments": [ { "end": 44, @@ -1543,8 +1563,8 @@ "shortName": "GetVulnerabilityReport" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_get_vulnerability_report_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_GetVulnerabilityReport_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_get_vulnerability_report_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_sync", "segments": [ { "end": 44, @@ -1588,16 +1608,16 @@ "shortName": "ListInventories" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListInventories_async", + "file": "osconfig_v1_generated_os_config_zonal_service_list_inventories_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListInventories_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1612,11 +1632,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1630,16 +1652,16 @@ "shortName": "ListInventories" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_inventories_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListInventories_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_list_inventories_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListInventories_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1654,11 +1676,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1673,16 +1697,16 @@ "shortName": "ListOSPolicyAssignmentReports" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListOSPolicyAssignmentReports_async", + "file": "osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1697,11 +1721,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1715,16 +1741,16 @@ "shortName": "ListOSPolicyAssignmentReports" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_reports_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListOSPolicyAssignmentReports_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1739,11 +1765,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1758,16 +1786,16 @@ "shortName": "ListOSPolicyAssignmentRevisions" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async", + "file": "osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1782,11 +1810,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1800,16 +1830,16 @@ "shortName": "ListOSPolicyAssignmentRevisions" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1824,11 +1854,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1843,16 +1875,16 @@ "shortName": "ListOSPolicyAssignments" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListOSPolicyAssignments_async", + "file": "osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1867,11 +1899,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1885,16 +1919,16 @@ "shortName": "ListOSPolicyAssignments" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_os_policy_assignments_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListOSPolicyAssignments_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_list_os_policy_assignments_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1909,11 +1943,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1928,16 +1964,16 @@ "shortName": "ListVulnerabilityReports" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListVulnerabilityReports_async", + "file": "osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1952,11 +1988,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -1970,16 +2008,16 @@ "shortName": "ListVulnerabilityReports" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_list_vulnerability_reports_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_ListVulnerabilityReports_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_list_vulnerability_reports_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -1994,11 +2032,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -2013,16 +2053,16 @@ "shortName": "UpdateOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_async.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_UpdateOSPolicyAssignment_async", + "file": "osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_async.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async", "segments": [ { - "end": 54, + "end": 56, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 56, "start": 27, "type": "SHORT" }, @@ -2037,11 +2077,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 53, "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 57, + "start": 54, "type": "RESPONSE_HANDLING" } ] @@ -2055,16 +2097,16 @@ "shortName": "UpdateOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1_os_config_zonal_service_update_os_policy_assignment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1_OsConfigZonalService_UpdateOSPolicyAssignment_sync", + "file": "osconfig_v1_generated_os_config_zonal_service_update_os_policy_assignment_sync.py", + "regionTag": "osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync", "segments": [ { - "end": 54, + "end": 56, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 56, "start": 27, "type": "SHORT" }, @@ -2079,11 +2121,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 53, "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 57, + "start": 54, "type": "RESPONSE_HANDLING" } ] diff --git a/packages/google-cloud-os-config/samples/generated_samples/snippet_metadata_osconfig_v1alpha.json b/packages/google-cloud-os-config/samples/generated_samples/snippet_metadata_osconfig_v1alpha.json index b70f5f92861e..ffc1c8c7d117 100644 --- a/packages/google-cloud-os-config/samples/generated_samples/snippet_metadata_osconfig_v1alpha.json +++ b/packages/google-cloud-os-config/samples/generated_samples/snippet_metadata_osconfig_v1alpha.json @@ -10,16 +10,16 @@ "shortName": "CreateOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_CreateOSPolicyAssignment_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_async", "segments": [ { - "end": 56, + "end": 58, "start": 27, "type": "FULL" }, { - "end": 56, + "end": 58, "start": 27, "type": "SHORT" }, @@ -34,11 +34,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 55, "start": 49, "type": "REQUEST_EXECUTION" }, { - "end": 57, + "end": 59, + "start": 56, "type": "RESPONSE_HANDLING" } ] @@ -52,16 +54,16 @@ "shortName": "CreateOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_create_os_policy_assignment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_CreateOSPolicyAssignment_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_create_os_policy_assignment_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync", "segments": [ { - "end": 56, + "end": 58, "start": 27, "type": "FULL" }, { - "end": 56, + "end": 58, "start": 27, "type": "SHORT" }, @@ -76,11 +78,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 55, "start": 49, "type": "REQUEST_EXECUTION" }, { - "end": 57, + "end": 59, + "start": 56, "type": "RESPONSE_HANDLING" } ] @@ -95,16 +99,16 @@ "shortName": "DeleteOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_DeleteOSPolicyAssignment_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_async", "segments": [ { - "end": 46, + "end": 48, "start": 27, "type": "FULL" }, { - "end": 46, + "end": 48, "start": 27, "type": "SHORT" }, @@ -119,11 +123,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 45, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 47, + "end": 49, + "start": 46, "type": "RESPONSE_HANDLING" } ] @@ -137,16 +143,16 @@ "shortName": "DeleteOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_delete_os_policy_assignment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_DeleteOSPolicyAssignment_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_delete_os_policy_assignment_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync", "segments": [ { - "end": 46, + "end": 48, "start": 27, "type": "FULL" }, { - "end": 46, + "end": 48, "start": 27, "type": "SHORT" }, @@ -161,11 +167,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 45, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 47, + "end": 49, + "start": 46, "type": "RESPONSE_HANDLING" } ] @@ -180,8 +188,8 @@ "shortName": "GetInstanceOSPoliciesCompliance" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_async", "segments": [ { "end": 44, @@ -224,8 +232,8 @@ "shortName": "GetInstanceOSPoliciesCompliance" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_instance_os_policies_compliance_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetInstanceOSPoliciesCompliance_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_instance_os_policies_compliance_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_sync", "segments": [ { "end": 44, @@ -269,8 +277,8 @@ "shortName": "GetInventory" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetInventory_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_async", "segments": [ { "end": 44, @@ -313,8 +321,97 @@ "shortName": "GetInventory" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_inventory_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetInventory_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_inventory_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "OsConfigZonalService" + }, + "shortName": "GetOSPolicyAssignmentReport" + } + }, + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "OsConfigZonalService" + }, + "shortName": "GetOSPolicyAssignmentReport" + } + }, + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_report_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync", "segments": [ { "end": 44, @@ -358,8 +455,8 @@ "shortName": "GetOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetOSPolicyAssignment_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_async", "segments": [ { "end": 44, @@ -402,8 +499,8 @@ "shortName": "GetOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_os_policy_assignment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetOSPolicyAssignment_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_os_policy_assignment_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_sync", "segments": [ { "end": 44, @@ -447,8 +544,8 @@ "shortName": "GetVulnerabilityReport" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetVulnerabilityReport_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_async", "segments": [ { "end": 44, @@ -491,8 +588,8 @@ "shortName": "GetVulnerabilityReport" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_get_vulnerability_report_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_GetVulnerabilityReport_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_get_vulnerability_report_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_sync", "segments": [ { "end": 44, @@ -536,16 +633,16 @@ "shortName": "ListInstanceOSPoliciesCompliances" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListInstanceOSPoliciesCompliances_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -560,11 +657,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -578,16 +677,16 @@ "shortName": "ListInstanceOSPoliciesCompliances" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_instance_os_policies_compliances_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListInstanceOSPoliciesCompliances_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_instance_os_policies_compliances_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -602,11 +701,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -621,16 +722,16 @@ "shortName": "ListInventories" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListInventories_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -645,11 +746,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -663,16 +766,16 @@ "shortName": "ListInventories" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_inventories_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListInventories_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_inventories_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -687,11 +790,102 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "OsConfigZonalService" + }, + "shortName": "ListOSPolicyAssignmentReports" + } + }, + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "OsConfigZonalService" + }, + "shortName": "ListOSPolicyAssignmentReports" + } + }, + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_reports_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -706,16 +900,16 @@ "shortName": "ListOSPolicyAssignmentRevisions" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -730,11 +924,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -748,16 +944,16 @@ "shortName": "ListOSPolicyAssignmentRevisions" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignment_revisions_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -772,11 +968,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -791,16 +989,16 @@ "shortName": "ListOSPolicyAssignments" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListOSPolicyAssignments_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -815,11 +1013,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -833,16 +1033,16 @@ "shortName": "ListOSPolicyAssignments" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_os_policy_assignments_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListOSPolicyAssignments_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_os_policy_assignments_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -857,11 +1057,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -876,16 +1078,16 @@ "shortName": "ListVulnerabilityReports" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListVulnerabilityReports_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_async", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -900,11 +1102,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -918,16 +1122,16 @@ "shortName": "ListVulnerabilityReports" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_list_vulnerability_reports_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_ListVulnerabilityReports_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_list_vulnerability_reports_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_sync", "segments": [ { - "end": 43, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 43, + "end": 45, "start": 27, "type": "SHORT" }, @@ -942,11 +1146,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 41, "start": 39, "type": "REQUEST_EXECUTION" }, { - "end": 44, + "end": 46, + "start": 42, "type": "RESPONSE_HANDLING" } ] @@ -961,16 +1167,16 @@ "shortName": "UpdateOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_async.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_UpdateOSPolicyAssignment_async", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_async.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_async", "segments": [ { - "end": 54, + "end": 56, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 56, "start": 27, "type": "SHORT" }, @@ -985,11 +1191,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 53, "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 57, + "start": 54, "type": "RESPONSE_HANDLING" } ] @@ -1003,16 +1211,16 @@ "shortName": "UpdateOSPolicyAssignment" } }, - "file": "osconfig_generated_osconfig_v1alpha_os_config_zonal_service_update_os_policy_assignment_sync.py", - "regionTag": "osconfig_generated_osconfig_v1alpha_OsConfigZonalService_UpdateOSPolicyAssignment_sync", + "file": "osconfig_v1alpha_generated_os_config_zonal_service_update_os_policy_assignment_sync.py", + "regionTag": "osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync", "segments": [ { - "end": 54, + "end": 56, "start": 27, "type": "FULL" }, { - "end": 54, + "end": 56, "start": 27, "type": "SHORT" }, @@ -1027,11 +1235,13 @@ "type": "REQUEST_INITIALIZATION" }, { + "end": 53, "start": 47, "type": "REQUEST_EXECUTION" }, { - "end": 55, + "end": 57, + "start": 54, "type": "RESPONSE_HANDLING" } ] diff --git a/packages/google-cloud-os-config/scripts/fixup_osconfig_v1_keywords.py b/packages/google-cloud-os-config/scripts/fixup_osconfig_v1_keywords.py index 19e12842a00d..3f3203f18155 100644 --- a/packages/google-cloud-os-config/scripts/fixup_osconfig_v1_keywords.py +++ b/packages/google-cloud-os-config/scripts/fixup_osconfig_v1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/scripts/fixup_osconfig_v1alpha_keywords.py b/packages/google-cloud-os-config/scripts/fixup_osconfig_v1alpha_keywords.py index df5d971407d8..ac4f29061144 100644 --- a/packages/google-cloud-os-config/scripts/fixup_osconfig_v1alpha_keywords.py +++ b/packages/google-cloud-os-config/scripts/fixup_osconfig_v1alpha_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,9 +44,11 @@ class osconfigCallTransformer(cst.CSTTransformer): 'get_instance_os_policies_compliance': ('name', ), 'get_inventory': ('name', 'view', ), 'get_os_policy_assignment': ('name', ), + 'get_os_policy_assignment_report': ('name', ), 'get_vulnerability_report': ('name', ), 'list_instance_os_policies_compliances': ('parent', 'page_size', 'page_token', 'filter', ), 'list_inventories': ('parent', 'view', 'page_size', 'page_token', 'filter', ), + 'list_os_policy_assignment_reports': ('parent', 'page_size', 'filter', 'page_token', ), 'list_os_policy_assignment_revisions': ('name', 'page_size', 'page_token', ), 'list_os_policy_assignments': ('parent', 'page_size', 'page_token', ), 'list_vulnerability_reports': ('parent', 'page_size', 'page_token', 'filter', ), diff --git a/packages/google-cloud-os-config/setup.py b/packages/google-cloud-os-config/setup.py index 040008d04945..8519ec3a1d24 100644 --- a/packages/google-cloud-os-config/setup.py +++ b/packages/google-cloud-os-config/setup.py @@ -35,7 +35,7 @@ # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 "google-api-core[grpc] >= 1.28.0, <3.0.0dev", - "proto-plus >= 1.10.0", + "proto-plus >= 1.15.0", ] extras = {} diff --git a/packages/google-cloud-os-config/testing/constraints-3.6.txt b/packages/google-cloud-os-config/testing/constraints-3.6.txt index da8c5737dc9d..aff6bee661dd 100644 --- a/packages/google-cloud-os-config/testing/constraints-3.6.txt +++ b/packages/google-cloud-os-config/testing/constraints-3.6.txt @@ -6,4 +6,4 @@ # e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", # Then this file should have foo==1.14.0 google-api-core==1.28.0 -proto-plus==1.10.0 +proto-plus==1.15.0 diff --git a/packages/google-cloud-os-config/tests/__init__.py b/packages/google-cloud-os-config/tests/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-os-config/tests/__init__.py +++ b/packages/google-cloud-os-config/tests/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/tests/unit/__init__.py b/packages/google-cloud-os-config/tests/unit/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-os-config/tests/unit/__init__.py +++ b/packages/google-cloud-os-config/tests/unit/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/tests/unit/gapic/__init__.py b/packages/google-cloud-os-config/tests/unit/gapic/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/__init__.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/__init__.py b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/__init__.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_service.py b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_service.py index f0cbf53ff8e7..9099ed806660 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_service.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_zonal_service.py b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_zonal_service.py index a31c52fa2075..d82b8a551193 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_zonal_service.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1/test_os_config_zonal_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/__init__.py b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/__init__.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/test_os_config_zonal_service.py b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/test_os_config_zonal_service.py index c8196adbd0e9..0e9a523d33ec 100644 --- a/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/test_os_config_zonal_service.py +++ b/packages/google-cloud-os-config/tests/unit/gapic/osconfig_v1alpha/test_os_config_zonal_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ from google.cloud.osconfig_v1alpha.types import instance_os_policies_compliance from google.cloud.osconfig_v1alpha.types import inventory from google.cloud.osconfig_v1alpha.types import os_policy +from google.cloud.osconfig_v1alpha.types import os_policy_assignment_reports from google.cloud.osconfig_v1alpha.types import os_policy_assignments from google.cloud.osconfig_v1alpha.types import osconfig_common from google.cloud.osconfig_v1alpha.types import vulnerability @@ -1197,6 +1198,7 @@ def test_get_os_policy_assignment(request_type, transport: str = "grpc"): name="name_value", description="description_value", revision_id="revision_id_value", + etag="etag_value", rollout_state=os_policy_assignments.OSPolicyAssignment.RolloutState.IN_PROGRESS, baseline=True, deleted=True, @@ -1215,6 +1217,7 @@ def test_get_os_policy_assignment(request_type, transport: str = "grpc"): assert response.name == "name_value" assert response.description == "description_value" assert response.revision_id == "revision_id_value" + assert response.etag == "etag_value" assert ( response.rollout_state == os_policy_assignments.OSPolicyAssignment.RolloutState.IN_PROGRESS @@ -1265,6 +1268,7 @@ async def test_get_os_policy_assignment_async( name="name_value", description="description_value", revision_id="revision_id_value", + etag="etag_value", rollout_state=os_policy_assignments.OSPolicyAssignment.RolloutState.IN_PROGRESS, baseline=True, deleted=True, @@ -1284,6 +1288,7 @@ async def test_get_os_policy_assignment_async( assert response.name == "name_value" assert response.description == "description_value" assert response.revision_id == "revision_id_value" + assert response.etag == "etag_value" assert ( response.rollout_state == os_policy_assignments.OSPolicyAssignment.RolloutState.IN_PROGRESS @@ -3205,6 +3210,697 @@ async def test_list_instance_os_policies_compliances_async_pages(): assert page_.raw_page.next_page_token == token +@pytest.mark.parametrize( + "request_type", + [os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest, dict,], +) +def test_get_os_policy_assignment_report(request_type, transport: str = "grpc"): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_os_policy_assignment_report), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = os_policy_assignment_reports.OSPolicyAssignmentReport( + name="name_value", + instance="instance_value", + os_policy_assignment="os_policy_assignment_value", + last_run_id="last_run_id_value", + ) + response = client.get_os_policy_assignment_report(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert ( + args[0] == os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest() + ) + + # Establish that the response is the type that we expect. + assert isinstance(response, os_policy_assignment_reports.OSPolicyAssignmentReport) + assert response.name == "name_value" + assert response.instance == "instance_value" + assert response.os_policy_assignment == "os_policy_assignment_value" + assert response.last_run_id == "last_run_id_value" + + +def test_get_os_policy_assignment_report_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_os_policy_assignment_report), "__call__" + ) as call: + client.get_os_policy_assignment_report() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert ( + args[0] == os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest() + ) + + +@pytest.mark.asyncio +async def test_get_os_policy_assignment_report_async( + transport: str = "grpc_asyncio", + request_type=os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest, +): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_os_policy_assignment_report), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + os_policy_assignment_reports.OSPolicyAssignmentReport( + name="name_value", + instance="instance_value", + os_policy_assignment="os_policy_assignment_value", + last_run_id="last_run_id_value", + ) + ) + response = await client.get_os_policy_assignment_report(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert ( + args[0] == os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest() + ) + + # Establish that the response is the type that we expect. + assert isinstance(response, os_policy_assignment_reports.OSPolicyAssignmentReport) + assert response.name == "name_value" + assert response.instance == "instance_value" + assert response.os_policy_assignment == "os_policy_assignment_value" + assert response.last_run_id == "last_run_id_value" + + +@pytest.mark.asyncio +async def test_get_os_policy_assignment_report_async_from_dict(): + await test_get_os_policy_assignment_report_async(request_type=dict) + + +def test_get_os_policy_assignment_report_field_headers(): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_os_policy_assignment_report), "__call__" + ) as call: + call.return_value = os_policy_assignment_reports.OSPolicyAssignmentReport() + client.get_os_policy_assignment_report(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_os_policy_assignment_report_field_headers_async(): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_os_policy_assignment_report), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + os_policy_assignment_reports.OSPolicyAssignmentReport() + ) + await client.get_os_policy_assignment_report(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +def test_get_os_policy_assignment_report_flattened(): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_os_policy_assignment_report), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = os_policy_assignment_reports.OSPolicyAssignmentReport() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_os_policy_assignment_report(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_get_os_policy_assignment_report_flattened_error(): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_os_policy_assignment_report( + os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_get_os_policy_assignment_report_flattened_async(): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_os_policy_assignment_report), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = os_policy_assignment_reports.OSPolicyAssignmentReport() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + os_policy_assignment_reports.OSPolicyAssignmentReport() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_os_policy_assignment_report(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_get_os_policy_assignment_report_flattened_error_async(): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_os_policy_assignment_report( + os_policy_assignment_reports.GetOSPolicyAssignmentReportRequest(), + name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", + [os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest, dict,], +) +def test_list_os_policy_assignment_reports(request_type, transport: str = "grpc"): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + next_page_token="next_page_token_value", + ) + response = client.list_os_policy_assignment_reports(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert ( + args[0] + == os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest() + ) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListOSPolicyAssignmentReportsPager) + assert response.next_page_token == "next_page_token_value" + + +def test_list_os_policy_assignment_reports_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + client.list_os_policy_assignment_reports() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert ( + args[0] + == os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest() + ) + + +@pytest.mark.asyncio +async def test_list_os_policy_assignment_reports_async( + transport: str = "grpc_asyncio", + request_type=os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest, +): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + next_page_token="next_page_token_value", + ) + ) + response = await client.list_os_policy_assignment_reports(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert ( + args[0] + == os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest() + ) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListOSPolicyAssignmentReportsAsyncPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.asyncio +async def test_list_os_policy_assignment_reports_async_from_dict(): + await test_list_os_policy_assignment_reports_async(request_type=dict) + + +def test_list_os_policy_assignment_reports_field_headers(): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + call.return_value = ( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse() + ) + client.list_os_policy_assignment_reports(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_list_os_policy_assignment_reports_field_headers_async(): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse() + ) + await client.list_os_policy_assignment_reports(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +def test_list_os_policy_assignment_reports_flattened(): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_os_policy_assignment_reports(parent="parent_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +def test_list_os_policy_assignment_reports_flattened_error(): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_os_policy_assignment_reports( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest(), + parent="parent_value", + ) + + +@pytest.mark.asyncio +async def test_list_os_policy_assignment_reports_flattened_async(): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse() + ) + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_os_policy_assignment_reports( + parent="parent_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_list_os_policy_assignment_reports_flattened_error_async(): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_os_policy_assignment_reports( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsRequest(), + parent="parent_value", + ) + + +def test_list_os_policy_assignment_reports_pager(transport_name: str = "grpc"): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + next_page_token="abc", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[], next_page_token="def", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + next_page_token="ghi", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)), + ) + pager = client.list_os_policy_assignment_reports(request={}) + + assert pager._metadata == metadata + + results = [i for i in pager] + assert len(results) == 6 + assert all( + isinstance(i, os_policy_assignment_reports.OSPolicyAssignmentReport) + for i in results + ) + + +def test_list_os_policy_assignment_reports_pages(transport_name: str = "grpc"): + client = OsConfigZonalServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + next_page_token="abc", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[], next_page_token="def", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + next_page_token="ghi", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + ), + RuntimeError, + ) + pages = list(client.list_os_policy_assignment_reports(request={}).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.asyncio +async def test_list_os_policy_assignment_reports_async_pager(): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + next_page_token="abc", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[], next_page_token="def", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + next_page_token="ghi", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_os_policy_assignment_reports(request={},) + assert async_pager.next_page_token == "abc" + responses = [] + async for response in async_pager: + responses.append(response) + + assert len(responses) == 6 + assert all( + isinstance(i, os_policy_assignment_reports.OSPolicyAssignmentReport) + for i in responses + ) + + +@pytest.mark.asyncio +async def test_list_os_policy_assignment_reports_async_pages(): + client = OsConfigZonalServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_os_policy_assignment_reports), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + next_page_token="abc", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[], next_page_token="def", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + next_page_token="ghi", + ), + os_policy_assignment_reports.ListOSPolicyAssignmentReportsResponse( + os_policy_assignment_reports=[ + os_policy_assignment_reports.OSPolicyAssignmentReport(), + os_policy_assignment_reports.OSPolicyAssignmentReport(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in ( + await client.list_os_policy_assignment_reports(request={}) + ).pages: + pages.append(page_) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + @pytest.mark.parametrize("request_type", [inventory.GetInventoryRequest, dict,]) def test_get_inventory(request_type, transport: str = "grpc"): client = OsConfigZonalServiceClient( @@ -4519,6 +5215,8 @@ def test_os_config_zonal_service_base_transport(): "delete_os_policy_assignment", "get_instance_os_policies_compliance", "list_instance_os_policies_compliances", + "get_os_policy_assignment_report", + "list_os_policy_assignment_reports", "get_inventory", "list_inventories", "get_vulnerability_report", @@ -4904,10 +5602,38 @@ def test_parse_instance_os_policies_compliance_path(): assert expected == actual -def test_inventory_path(): +def test_instance_os_policy_assignment_path(): project = "squid" location = "clam" instance = "whelk" + assignment = "octopus" + expected = "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}".format( + project=project, location=location, instance=instance, assignment=assignment, + ) + actual = OsConfigZonalServiceClient.instance_os_policy_assignment_path( + project, location, instance, assignment + ) + assert expected == actual + + +def test_parse_instance_os_policy_assignment_path(): + expected = { + "project": "oyster", + "location": "nudibranch", + "instance": "cuttlefish", + "assignment": "mussel", + } + path = OsConfigZonalServiceClient.instance_os_policy_assignment_path(**expected) + + # Check that the path construction is reversible. + actual = OsConfigZonalServiceClient.parse_instance_os_policy_assignment_path(path) + assert expected == actual + + +def test_inventory_path(): + project = "winkle" + location = "nautilus" + instance = "scallop" expected = "projects/{project}/locations/{location}/instances/{instance}/inventory".format( project=project, location=location, instance=instance, ) @@ -4917,9 +5643,9 @@ def test_inventory_path(): def test_parse_inventory_path(): expected = { - "project": "octopus", - "location": "oyster", - "instance": "nudibranch", + "project": "abalone", + "location": "squid", + "instance": "clam", } path = OsConfigZonalServiceClient.inventory_path(**expected) @@ -4929,9 +5655,9 @@ def test_parse_inventory_path(): def test_os_policy_assignment_path(): - project = "cuttlefish" - location = "mussel" - os_policy_assignment = "winkle" + project = "whelk" + location = "octopus" + os_policy_assignment = "oyster" expected = "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}".format( project=project, location=location, os_policy_assignment=os_policy_assignment, ) @@ -4943,9 +5669,9 @@ def test_os_policy_assignment_path(): def test_parse_os_policy_assignment_path(): expected = { - "project": "nautilus", - "location": "scallop", - "os_policy_assignment": "abalone", + "project": "nudibranch", + "location": "cuttlefish", + "os_policy_assignment": "mussel", } path = OsConfigZonalServiceClient.os_policy_assignment_path(**expected) @@ -4954,10 +5680,38 @@ def test_parse_os_policy_assignment_path(): assert expected == actual +def test_os_policy_assignment_report_path(): + project = "winkle" + location = "nautilus" + instance = "scallop" + assignment = "abalone" + expected = "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report".format( + project=project, location=location, instance=instance, assignment=assignment, + ) + actual = OsConfigZonalServiceClient.os_policy_assignment_report_path( + project, location, instance, assignment + ) + assert expected == actual + + +def test_parse_os_policy_assignment_report_path(): + expected = { + "project": "squid", + "location": "clam", + "instance": "whelk", + "assignment": "octopus", + } + path = OsConfigZonalServiceClient.os_policy_assignment_report_path(**expected) + + # Check that the path construction is reversible. + actual = OsConfigZonalServiceClient.parse_os_policy_assignment_report_path(path) + assert expected == actual + + def test_vulnerability_report_path(): - project = "squid" - location = "clam" - instance = "whelk" + project = "oyster" + location = "nudibranch" + instance = "cuttlefish" expected = "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport".format( project=project, location=location, instance=instance, ) @@ -4969,9 +5723,9 @@ def test_vulnerability_report_path(): def test_parse_vulnerability_report_path(): expected = { - "project": "octopus", - "location": "oyster", - "instance": "nudibranch", + "project": "mussel", + "location": "winkle", + "instance": "nautilus", } path = OsConfigZonalServiceClient.vulnerability_report_path(**expected) @@ -4981,7 +5735,7 @@ def test_parse_vulnerability_report_path(): def test_common_billing_account_path(): - billing_account = "cuttlefish" + billing_account = "scallop" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -4991,7 +5745,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "mussel", + "billing_account": "abalone", } path = OsConfigZonalServiceClient.common_billing_account_path(**expected) @@ -5001,7 +5755,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "winkle" + folder = "squid" expected = "folders/{folder}".format(folder=folder,) actual = OsConfigZonalServiceClient.common_folder_path(folder) assert expected == actual @@ -5009,7 +5763,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "nautilus", + "folder": "clam", } path = OsConfigZonalServiceClient.common_folder_path(**expected) @@ -5019,7 +5773,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "scallop" + organization = "whelk" expected = "organizations/{organization}".format(organization=organization,) actual = OsConfigZonalServiceClient.common_organization_path(organization) assert expected == actual @@ -5027,7 +5781,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "abalone", + "organization": "octopus", } path = OsConfigZonalServiceClient.common_organization_path(**expected) @@ -5037,7 +5791,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "squid" + project = "oyster" expected = "projects/{project}".format(project=project,) actual = OsConfigZonalServiceClient.common_project_path(project) assert expected == actual @@ -5045,7 +5799,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "clam", + "project": "nudibranch", } path = OsConfigZonalServiceClient.common_project_path(**expected) @@ -5055,8 +5809,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "whelk" - location = "octopus" + project = "cuttlefish" + location = "mussel" expected = "projects/{project}/locations/{location}".format( project=project, location=location, ) @@ -5066,8 +5820,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "oyster", - "location": "nudibranch", + "project": "winkle", + "location": "nautilus", } path = OsConfigZonalServiceClient.common_location_path(**expected)