34 releases (18 stable)
6.0.0+20240604 | Oct 15, 2024 |
---|---|
5.0.5+20240604 | Jun 27, 2024 |
5.0.4+20240218 | Mar 5, 2024 |
5.0.3+20230103 | Aug 23, 2023 |
0.1.2+20150302 | Mar 25, 2015 |
#336 in Database interfaces
313 downloads per month
Used in google-compute1-cli
15MB
194K
SLoC
The google-compute1
library allows access to all features of the Google compute service.
This documentation was generated from compute crate version 6.0.0+20240604, where 20240604 is the exact revision of the compute:v1 schema built by the mako code generator v6.0.0.
Everything else about the compute v1 API can be found at the official documentation site.
Features
Handle the following Resources with ease from the central hub ...
- accelerator types
- aggregated list, get and list
- addresses
- aggregated list, delete, get, insert, list, move and set labels
- autoscalers
- aggregated list, delete, get, insert, list, patch and update
- backend buckets
- add signed url key, delete, delete signed url key, get, get iam policy, insert, list, patch, set edge security policy, set iam policy, test iam permissions and update
- backend services
- add signed url key, aggregated list, delete, delete signed url key, get, get health, get iam policy, insert, list, list usable, patch, set edge security policy, set iam policy, set security policy, test iam permissions and update
- disk types
- aggregated list, get and list
- disks
- add resource policies, aggregated list, bulk insert, create snapshot, delete, get, get iam policy, insert, list, remove resource policies, resize, set iam policy, set labels, start async replication, stop async replication, stop group async replication, test iam permissions and update
- external vpn gateways
- delete, get, insert, list, set labels and test iam permissions
- firewall policies
- add association, add rule, clone rules, delete, get, get association, get iam policy, get rule, insert, list, list associations, move, patch, patch rule, remove association, remove rule, set iam policy and test iam permissions
- firewalls
- delete, get, insert, list, patch and update
- forwarding rules
- aggregated list, delete, get, insert, list, patch, set labels and set target
- global addresses
- delete, get, insert, list, move and set labels
- global forwarding rules
- delete, get, insert, list, patch, set labels and set target
- global network endpoint groups
- attach network endpoints, delete, detach network endpoints, get, insert, list and list network endpoints
- global operations
- aggregated list, delete, get, list and wait
- global organization operations
- delete, get and list
- global public delegated prefixes
- delete, get, insert, list and patch
- health checks
- aggregated list, delete, get, insert, list, patch and update
- http health checks
- delete, get, insert, list, patch and update
- https health checks
- delete, get, insert, list, patch and update
- image family views
- get
- images
- delete, deprecate, get, get from family, get iam policy, insert, list, patch, set iam policy, set labels and test iam permissions
- instance group manager resize requests
- cancel, delete, get, insert and list
- instance group managers
- abandon instances, aggregated list, apply updates to instances, create instances, delete, delete instances, delete per instance configs, get, insert, list, list errors, list managed instances, list per instance configs, patch, patch per instance configs, recreate instances, resize, set instance template, set target pools and update per instance configs
- instance groups
- add instances, aggregated list, delete, get, insert, list, list instances, remove instances and set named ports
- instance settings
- get and patch
- instance templates
- aggregated list, delete, get, get iam policy, insert, list, set iam policy and test iam permissions
- instances
- add access config, add resource policies, aggregated list, attach disk, bulk insert, delete, delete access config, detach disk, get, get effective firewalls, get guest attributes, get iam policy, get screenshot, get serial port output, get shielded instance identity, insert, list, list referrers, perform maintenance, remove resource policies, reset, resume, send diagnostic interrupt, set deletion protection, set disk auto delete, set iam policy, set labels, set machine resources, set machine type, set metadata, set min cpu platform, set name, set scheduling, set security policy, set service account, set shielded instance integrity policy, set tags, simulate maintenance event, start, start with encryption key, stop, suspend, test iam permissions, update, update access config, update display device, update network interface and update shielded instance config
- instant snapshots
- aggregated list, delete, get, get iam policy, insert, list, set iam policy, set labels and test iam permissions
- interconnect attachments
- aggregated list, delete, get, insert, list, patch and set labels
- interconnect locations
- get and list
- interconnect remote locations
- get and list
- interconnects
- delete, get, get diagnostics, get macsec config, insert, list, patch and set labels
- license codes
- get and test iam permissions
- licenses
- delete, get, get iam policy, insert, list, set iam policy and test iam permissions
- machine images
- delete, get, get iam policy, insert, list, set iam policy and test iam permissions
- machine types
- aggregated list, get and list
- network attachments
- aggregated list, delete, get, get iam policy, insert, list, patch, set iam policy and test iam permissions
- network edge security services
- aggregated list, delete, get, insert and patch
- network endpoint groups
- aggregated list, attach network endpoints, delete, detach network endpoints, get, insert, list, list network endpoints and test iam permissions
- network firewall policies
- add association, add rule, clone rules, delete, get, get association, get iam policy, get rule, insert, list, patch, patch rule, remove association, remove rule, set iam policy and test iam permissions
- networks
- add peering, delete, get, get effective firewalls, insert, list, list peering routes, patch, remove peering, switch to custom mode and update peering
- node groups
- add nodes, aggregated list, delete, delete nodes, get, get iam policy, insert, list, list nodes, patch, perform maintenance, set iam policy, set node template, simulate maintenance event and test iam permissions
- node templates
- aggregated list, delete, get, get iam policy, insert, list, set iam policy and test iam permissions
- node types
- aggregated list, get and list
- packet mirrorings
- aggregated list, delete, get, insert, list, patch and test iam permissions
- projects
- disable xpn host, disable xpn resource, enable xpn host, enable xpn resource, get, get xpn host, get xpn resources, list xpn hosts, move disk, move instance, set cloud armor tier, set common instance metadata, set default network tier and set usage export bucket
- public advertised prefixes
- announce, delete, get, insert, list, patch and withdraw
- public delegated prefixes
- aggregated list, announce, delete, get, insert, list, patch and withdraw
- region autoscalers
- delete, get, insert, list, patch and update
- region backend services
- delete, get, get health, get iam policy, insert, list, list usable, patch, set iam policy, set security policy, test iam permissions and update
- region commitments
- aggregated list, get, insert, list and update
- region disk types
- get and list
- region disks
- add resource policies, bulk insert, create snapshot, delete, get, get iam policy, insert, list, remove resource policies, resize, set iam policy, set labels, start async replication, stop async replication, stop group async replication, test iam permissions and update
- region health check services
- delete, get, insert, list and patch
- region health checks
- delete, get, insert, list, patch and update
- region instance group managers
- abandon instances, apply updates to instances, create instances, delete, delete instances, delete per instance configs, get, insert, list, list errors, list managed instances, list per instance configs, patch, patch per instance configs, recreate instances, resize, set instance template, set target pools and update per instance configs
- region instance groups
- get, list, list instances and set named ports
- region instance templates
- delete, get, insert and list
- region instances
- bulk insert
- region instant snapshots
- delete, get, get iam policy, insert, list, set iam policy, set labels and test iam permissions
- region network endpoint groups
- attach network endpoints, delete, detach network endpoints, get, insert, list and list network endpoints
- region network firewall policies
- add association, add rule, clone rules, delete, get, get association, get effective firewalls, get iam policy, get rule, insert, list, patch, patch rule, remove association, remove rule, set iam policy and test iam permissions
- region notification endpoints
- delete, get, insert and list
- region operations
- delete, get, list and wait
- region security policies
- add rule, delete, get, get rule, insert, list, patch, patch rule and remove rule
- region ssl certificates
- delete, get, insert and list
- region ssl policies
- delete, get, insert, list, list available features and patch
- region target http proxies
- delete, get, insert, list and set url map
- region target https proxies
- delete, get, insert, list, patch, set ssl certificates and set url map
- region target tcp proxies
- delete, get, insert and list
- region url maps
- delete, get, insert, list, patch, update and validate
- region zones
- list
- regions
- get and list
- reservations
- aggregated list, delete, get, get iam policy, insert, list, resize, set iam policy, test iam permissions and update
- resource policies
- aggregated list, delete, get, get iam policy, insert, list, patch, set iam policy and test iam permissions
- routers
- aggregated list, delete, get, get nat ip info, get nat mapping info, get router status, insert, list, patch, preview and update
- routes
- delete, get, insert and list
- security policies
- add rule, aggregated list, delete, get, get rule, insert, list, list preconfigured expression sets, patch, patch rule, remove rule and set labels
- service attachments
- aggregated list, delete, get, get iam policy, insert, list, patch, set iam policy and test iam permissions
- snapshot settings
- get and patch
- snapshots
- delete, get, get iam policy, insert, list, set iam policy, set labels and test iam permissions
- ssl certificates
- aggregated list, delete, get, insert and list
- ssl policies
- aggregated list, delete, get, insert, list, list available features and patch
- storage pool types
- aggregated list, get and list
- storage pools
- aggregated list, delete, get, get iam policy, insert, list, list disks, set iam policy, test iam permissions and update
- subnetworks
- aggregated list, delete, expand ip cidr range, get, get iam policy, insert, list, list usable, patch, set iam policy, set private ip google access and test iam permissions
- target grpc proxies
- delete, get, insert, list and patch
- target http proxies
- aggregated list, delete, get, insert, list, patch and set url map
- target https proxies
- aggregated list, delete, get, insert, list, patch, set certificate map, set quic override, set ssl certificates, set ssl policy and set url map
- target instances
- aggregated list, delete, get, insert, list and set security policy
- target pools
- add health check, add instance, aggregated list, delete, get, get health, insert, list, remove health check, remove instance, set backup and set security policy
- target ssl proxies
- delete, get, insert, list, set backend service, set certificate map, set proxy header, set ssl certificates and set ssl policy
- target tcp proxies
- aggregated list, delete, get, insert, list, set backend service and set proxy header
- target vpn gateways
- aggregated list, delete, get, insert, list and set labels
- url maps
- aggregated list, delete, get, insert, invalidate cache, list, patch, update and validate
- vpn gateways
- aggregated list, delete, get, get status, insert, list, set labels and test iam permissions
- vpn tunnels
- aggregated list, delete, get, insert, list and set labels
- zone operations
- delete, get, list and wait
- zones
- get and list
Structure of this Library
The API is structured into the following primary items:
- Hub
- a central object to maintain state and allow accessing all Activities
- creates Method Builders which in turn allow access to individual Call Builders
- Resources
- primary types that you can apply Activities to
- a collection of properties and Parts
- Parts
- a collection of properties
- never directly used in Activities
- Activities
- operations to apply to Resources
All structures are marked with applicable traits to further categorize them and ease browsing.
Generally speaking, you can invoke Activities like this:
let r = hub.resource().activity(...).doit().await
Or specifically ...
let r = hub.addresses().delete(...).doit().await
let r = hub.addresses().insert(...).doit().await
let r = hub.addresses().move_(...).doit().await
let r = hub.addresses().set_labels(...).doit().await
let r = hub.autoscalers().delete(...).doit().await
let r = hub.autoscalers().insert(...).doit().await
let r = hub.autoscalers().patch(...).doit().await
let r = hub.autoscalers().update(...).doit().await
let r = hub.backend_buckets().add_signed_url_key(...).doit().await
let r = hub.backend_buckets().delete(...).doit().await
let r = hub.backend_buckets().delete_signed_url_key(...).doit().await
let r = hub.backend_buckets().insert(...).doit().await
let r = hub.backend_buckets().patch(...).doit().await
let r = hub.backend_buckets().set_edge_security_policy(...).doit().await
let r = hub.backend_buckets().update(...).doit().await
let r = hub.backend_services().add_signed_url_key(...).doit().await
let r = hub.backend_services().delete(...).doit().await
let r = hub.backend_services().delete_signed_url_key(...).doit().await
let r = hub.backend_services().insert(...).doit().await
let r = hub.backend_services().patch(...).doit().await
let r = hub.backend_services().set_edge_security_policy(...).doit().await
let r = hub.backend_services().set_security_policy(...).doit().await
let r = hub.backend_services().update(...).doit().await
let r = hub.disks().add_resource_policies(...).doit().await
let r = hub.disks().bulk_insert(...).doit().await
let r = hub.disks().create_snapshot(...).doit().await
let r = hub.disks().delete(...).doit().await
let r = hub.disks().insert(...).doit().await
let r = hub.disks().remove_resource_policies(...).doit().await
let r = hub.disks().resize(...).doit().await
let r = hub.disks().set_labels(...).doit().await
let r = hub.disks().start_async_replication(...).doit().await
let r = hub.disks().stop_async_replication(...).doit().await
let r = hub.disks().stop_group_async_replication(...).doit().await
let r = hub.disks().update(...).doit().await
let r = hub.external_vpn_gateways().delete(...).doit().await
let r = hub.external_vpn_gateways().insert(...).doit().await
let r = hub.external_vpn_gateways().set_labels(...).doit().await
let r = hub.firewall_policies().add_association(...).doit().await
let r = hub.firewall_policies().add_rule(...).doit().await
let r = hub.firewall_policies().clone_rules(...).doit().await
let r = hub.firewall_policies().delete(...).doit().await
let r = hub.firewall_policies().insert(...).doit().await
let r = hub.firewall_policies().move_(...).doit().await
let r = hub.firewall_policies().patch(...).doit().await
let r = hub.firewall_policies().patch_rule(...).doit().await
let r = hub.firewall_policies().remove_association(...).doit().await
let r = hub.firewall_policies().remove_rule(...).doit().await
let r = hub.firewalls().delete(...).doit().await
let r = hub.firewalls().insert(...).doit().await
let r = hub.firewalls().patch(...).doit().await
let r = hub.firewalls().update(...).doit().await
let r = hub.forwarding_rules().delete(...).doit().await
let r = hub.forwarding_rules().insert(...).doit().await
let r = hub.forwarding_rules().patch(...).doit().await
let r = hub.forwarding_rules().set_labels(...).doit().await
let r = hub.forwarding_rules().set_target(...).doit().await
let r = hub.global_addresses().delete(...).doit().await
let r = hub.global_addresses().insert(...).doit().await
let r = hub.global_addresses().move_(...).doit().await
let r = hub.global_addresses().set_labels(...).doit().await
let r = hub.global_forwarding_rules().delete(...).doit().await
let r = hub.global_forwarding_rules().insert(...).doit().await
let r = hub.global_forwarding_rules().patch(...).doit().await
let r = hub.global_forwarding_rules().set_labels(...).doit().await
let r = hub.global_forwarding_rules().set_target(...).doit().await
let r = hub.global_network_endpoint_groups().attach_network_endpoints(...).doit().await
let r = hub.global_network_endpoint_groups().delete(...).doit().await
let r = hub.global_network_endpoint_groups().detach_network_endpoints(...).doit().await
let r = hub.global_network_endpoint_groups().insert(...).doit().await
let r = hub.global_operations().get(...).doit().await
let r = hub.global_operations().wait(...).doit().await
let r = hub.global_organization_operations().get(...).doit().await
let r = hub.global_public_delegated_prefixes().delete(...).doit().await
let r = hub.global_public_delegated_prefixes().insert(...).doit().await
let r = hub.global_public_delegated_prefixes().patch(...).doit().await
let r = hub.health_checks().delete(...).doit().await
let r = hub.health_checks().insert(...).doit().await
let r = hub.health_checks().patch(...).doit().await
let r = hub.health_checks().update(...).doit().await
let r = hub.http_health_checks().delete(...).doit().await
let r = hub.http_health_checks().insert(...).doit().await
let r = hub.http_health_checks().patch(...).doit().await
let r = hub.http_health_checks().update(...).doit().await
let r = hub.https_health_checks().delete(...).doit().await
let r = hub.https_health_checks().insert(...).doit().await
let r = hub.https_health_checks().patch(...).doit().await
let r = hub.https_health_checks().update(...).doit().await
let r = hub.images().delete(...).doit().await
let r = hub.images().deprecate(...).doit().await
let r = hub.images().insert(...).doit().await
let r = hub.images().patch(...).doit().await
let r = hub.images().set_labels(...).doit().await
let r = hub.instance_group_manager_resize_requests().cancel(...).doit().await
let r = hub.instance_group_manager_resize_requests().delete(...).doit().await
let r = hub.instance_group_manager_resize_requests().insert(...).doit().await
let r = hub.instance_group_managers().abandon_instances(...).doit().await
let r = hub.instance_group_managers().apply_updates_to_instances(...).doit().await
let r = hub.instance_group_managers().create_instances(...).doit().await
let r = hub.instance_group_managers().delete(...).doit().await
let r = hub.instance_group_managers().delete_instances(...).doit().await
let r = hub.instance_group_managers().delete_per_instance_configs(...).doit().await
let r = hub.instance_group_managers().insert(...).doit().await
let r = hub.instance_group_managers().patch(...).doit().await
let r = hub.instance_group_managers().patch_per_instance_configs(...).doit().await
let r = hub.instance_group_managers().recreate_instances(...).doit().await
let r = hub.instance_group_managers().resize(...).doit().await
let r = hub.instance_group_managers().set_instance_template(...).doit().await
let r = hub.instance_group_managers().set_target_pools(...).doit().await
let r = hub.instance_group_managers().update_per_instance_configs(...).doit().await
let r = hub.instance_groups().add_instances(...).doit().await
let r = hub.instance_groups().delete(...).doit().await
let r = hub.instance_groups().insert(...).doit().await
let r = hub.instance_groups().remove_instances(...).doit().await
let r = hub.instance_groups().set_named_ports(...).doit().await
let r = hub.instance_settings().patch(...).doit().await
let r = hub.instance_templates().delete(...).doit().await
let r = hub.instance_templates().insert(...).doit().await
let r = hub.instances().add_access_config(...).doit().await
let r = hub.instances().add_resource_policies(...).doit().await
let r = hub.instances().attach_disk(...).doit().await
let r = hub.instances().bulk_insert(...).doit().await
let r = hub.instances().delete(...).doit().await
let r = hub.instances().delete_access_config(...).doit().await
let r = hub.instances().detach_disk(...).doit().await
let r = hub.instances().insert(...).doit().await
let r = hub.instances().perform_maintenance(...).doit().await
let r = hub.instances().remove_resource_policies(...).doit().await
let r = hub.instances().reset(...).doit().await
let r = hub.instances().resume(...).doit().await
let r = hub.instances().set_deletion_protection(...).doit().await
let r = hub.instances().set_disk_auto_delete(...).doit().await
let r = hub.instances().set_labels(...).doit().await
let r = hub.instances().set_machine_resources(...).doit().await
let r = hub.instances().set_machine_type(...).doit().await
let r = hub.instances().set_metadata(...).doit().await
let r = hub.instances().set_min_cpu_platform(...).doit().await
let r = hub.instances().set_name(...).doit().await
let r = hub.instances().set_scheduling(...).doit().await
let r = hub.instances().set_security_policy(...).doit().await
let r = hub.instances().set_service_account(...).doit().await
let r = hub.instances().set_shielded_instance_integrity_policy(...).doit().await
let r = hub.instances().set_tags(...).doit().await
let r = hub.instances().simulate_maintenance_event(...).doit().await
let r = hub.instances().start(...).doit().await
let r = hub.instances().start_with_encryption_key(...).doit().await
let r = hub.instances().stop(...).doit().await
let r = hub.instances().suspend(...).doit().await
let r = hub.instances().update(...).doit().await
let r = hub.instances().update_access_config(...).doit().await
let r = hub.instances().update_display_device(...).doit().await
let r = hub.instances().update_network_interface(...).doit().await
let r = hub.instances().update_shielded_instance_config(...).doit().await
let r = hub.instant_snapshots().delete(...).doit().await
let r = hub.instant_snapshots().insert(...).doit().await
let r = hub.instant_snapshots().set_labels(...).doit().await
let r = hub.interconnect_attachments().delete(...).doit().await
let r = hub.interconnect_attachments().insert(...).doit().await
let r = hub.interconnect_attachments().patch(...).doit().await
let r = hub.interconnect_attachments().set_labels(...).doit().await
let r = hub.interconnects().delete(...).doit().await
let r = hub.interconnects().insert(...).doit().await
let r = hub.interconnects().patch(...).doit().await
let r = hub.interconnects().set_labels(...).doit().await
let r = hub.licenses().delete(...).doit().await
let r = hub.licenses().insert(...).doit().await
let r = hub.machine_images().delete(...).doit().await
let r = hub.machine_images().insert(...).doit().await
let r = hub.network_attachments().delete(...).doit().await
let r = hub.network_attachments().insert(...).doit().await
let r = hub.network_attachments().patch(...).doit().await
let r = hub.network_edge_security_services().delete(...).doit().await
let r = hub.network_edge_security_services().insert(...).doit().await
let r = hub.network_edge_security_services().patch(...).doit().await
let r = hub.network_endpoint_groups().attach_network_endpoints(...).doit().await
let r = hub.network_endpoint_groups().delete(...).doit().await
let r = hub.network_endpoint_groups().detach_network_endpoints(...).doit().await
let r = hub.network_endpoint_groups().insert(...).doit().await
let r = hub.network_firewall_policies().add_association(...).doit().await
let r = hub.network_firewall_policies().add_rule(...).doit().await
let r = hub.network_firewall_policies().clone_rules(...).doit().await
let r = hub.network_firewall_policies().delete(...).doit().await
let r = hub.network_firewall_policies().insert(...).doit().await
let r = hub.network_firewall_policies().patch(...).doit().await
let r = hub.network_firewall_policies().patch_rule(...).doit().await
let r = hub.network_firewall_policies().remove_association(...).doit().await
let r = hub.network_firewall_policies().remove_rule(...).doit().await
let r = hub.networks().add_peering(...).doit().await
let r = hub.networks().delete(...).doit().await
let r = hub.networks().insert(...).doit().await
let r = hub.networks().patch(...).doit().await
let r = hub.networks().remove_peering(...).doit().await
let r = hub.networks().switch_to_custom_mode(...).doit().await
let r = hub.networks().update_peering(...).doit().await
let r = hub.node_groups().add_nodes(...).doit().await
let r = hub.node_groups().delete(...).doit().await
let r = hub.node_groups().delete_nodes(...).doit().await
let r = hub.node_groups().insert(...).doit().await
let r = hub.node_groups().patch(...).doit().await
let r = hub.node_groups().perform_maintenance(...).doit().await
let r = hub.node_groups().set_node_template(...).doit().await
let r = hub.node_groups().simulate_maintenance_event(...).doit().await
let r = hub.node_templates().delete(...).doit().await
let r = hub.node_templates().insert(...).doit().await
let r = hub.packet_mirrorings().delete(...).doit().await
let r = hub.packet_mirrorings().insert(...).doit().await
let r = hub.packet_mirrorings().patch(...).doit().await
let r = hub.projects().disable_xpn_host(...).doit().await
let r = hub.projects().disable_xpn_resource(...).doit().await
let r = hub.projects().enable_xpn_host(...).doit().await
let r = hub.projects().enable_xpn_resource(...).doit().await
let r = hub.projects().move_disk(...).doit().await
let r = hub.projects().move_instance(...).doit().await
let r = hub.projects().set_cloud_armor_tier(...).doit().await
let r = hub.projects().set_common_instance_metadata(...).doit().await
let r = hub.projects().set_default_network_tier(...).doit().await
let r = hub.projects().set_usage_export_bucket(...).doit().await
let r = hub.public_advertised_prefixes().announce(...).doit().await
let r = hub.public_advertised_prefixes().delete(...).doit().await
let r = hub.public_advertised_prefixes().insert(...).doit().await
let r = hub.public_advertised_prefixes().patch(...).doit().await
let r = hub.public_advertised_prefixes().withdraw(...).doit().await
let r = hub.public_delegated_prefixes().announce(...).doit().await
let r = hub.public_delegated_prefixes().delete(...).doit().await
let r = hub.public_delegated_prefixes().insert(...).doit().await
let r = hub.public_delegated_prefixes().patch(...).doit().await
let r = hub.public_delegated_prefixes().withdraw(...).doit().await
let r = hub.region_autoscalers().delete(...).doit().await
let r = hub.region_autoscalers().insert(...).doit().await
let r = hub.region_autoscalers().patch(...).doit().await
let r = hub.region_autoscalers().update(...).doit().await
let r = hub.region_backend_services().delete(...).doit().await
let r = hub.region_backend_services().insert(...).doit().await
let r = hub.region_backend_services().patch(...).doit().await
let r = hub.region_backend_services().set_security_policy(...).doit().await
let r = hub.region_backend_services().update(...).doit().await
let r = hub.region_commitments().insert(...).doit().await
let r = hub.region_commitments().update(...).doit().await
let r = hub.region_disks().add_resource_policies(...).doit().await
let r = hub.region_disks().bulk_insert(...).doit().await
let r = hub.region_disks().create_snapshot(...).doit().await
let r = hub.region_disks().delete(...).doit().await
let r = hub.region_disks().insert(...).doit().await
let r = hub.region_disks().remove_resource_policies(...).doit().await
let r = hub.region_disks().resize(...).doit().await
let r = hub.region_disks().set_labels(...).doit().await
let r = hub.region_disks().start_async_replication(...).doit().await
let r = hub.region_disks().stop_async_replication(...).doit().await
let r = hub.region_disks().stop_group_async_replication(...).doit().await
let r = hub.region_disks().update(...).doit().await
let r = hub.region_health_check_services().delete(...).doit().await
let r = hub.region_health_check_services().insert(...).doit().await
let r = hub.region_health_check_services().patch(...).doit().await
let r = hub.region_health_checks().delete(...).doit().await
let r = hub.region_health_checks().insert(...).doit().await
let r = hub.region_health_checks().patch(...).doit().await
let r = hub.region_health_checks().update(...).doit().await
let r = hub.region_instance_group_managers().abandon_instances(...).doit().await
let r = hub.region_instance_group_managers().apply_updates_to_instances(...).doit().await
let r = hub.region_instance_group_managers().create_instances(...).doit().await
let r = hub.region_instance_group_managers().delete(...).doit().await
let r = hub.region_instance_group_managers().delete_instances(...).doit().await
let r = hub.region_instance_group_managers().delete_per_instance_configs(...).doit().await
let r = hub.region_instance_group_managers().insert(...).doit().await
let r = hub.region_instance_group_managers().patch(...).doit().await
let r = hub.region_instance_group_managers().patch_per_instance_configs(...).doit().await
let r = hub.region_instance_group_managers().recreate_instances(...).doit().await
let r = hub.region_instance_group_managers().resize(...).doit().await
let r = hub.region_instance_group_managers().set_instance_template(...).doit().await
let r = hub.region_instance_group_managers().set_target_pools(...).doit().await
let r = hub.region_instance_group_managers().update_per_instance_configs(...).doit().await
let r = hub.region_instance_groups().set_named_ports(...).doit().await
let r = hub.region_instance_templates().delete(...).doit().await
let r = hub.region_instance_templates().insert(...).doit().await
let r = hub.region_instances().bulk_insert(...).doit().await
let r = hub.region_instant_snapshots().delete(...).doit().await
let r = hub.region_instant_snapshots().insert(...).doit().await
let r = hub.region_instant_snapshots().set_labels(...).doit().await
let r = hub.region_network_endpoint_groups().attach_network_endpoints(...).doit().await
let r = hub.region_network_endpoint_groups().delete(...).doit().await
let r = hub.region_network_endpoint_groups().detach_network_endpoints(...).doit().await
let r = hub.region_network_endpoint_groups().insert(...).doit().await
let r = hub.region_network_firewall_policies().add_association(...).doit().await
let r = hub.region_network_firewall_policies().add_rule(...).doit().await
let r = hub.region_network_firewall_policies().clone_rules(...).doit().await
let r = hub.region_network_firewall_policies().delete(...).doit().await
let r = hub.region_network_firewall_policies().insert(...).doit().await
let r = hub.region_network_firewall_policies().patch(...).doit().await
let r = hub.region_network_firewall_policies().patch_rule(...).doit().await
let r = hub.region_network_firewall_policies().remove_association(...).doit().await
let r = hub.region_network_firewall_policies().remove_rule(...).doit().await
let r = hub.region_notification_endpoints().delete(...).doit().await
let r = hub.region_notification_endpoints().insert(...).doit().await
let r = hub.region_operations().get(...).doit().await
let r = hub.region_operations().wait(...).doit().await
let r = hub.region_security_policies().add_rule(...).doit().await
let r = hub.region_security_policies().delete(...).doit().await
let r = hub.region_security_policies().insert(...).doit().await
let r = hub.region_security_policies().patch(...).doit().await
let r = hub.region_security_policies().patch_rule(...).doit().await
let r = hub.region_security_policies().remove_rule(...).doit().await
let r = hub.region_ssl_certificates().delete(...).doit().await
let r = hub.region_ssl_certificates().insert(...).doit().await
let r = hub.region_ssl_policies().delete(...).doit().await
let r = hub.region_ssl_policies().insert(...).doit().await
let r = hub.region_ssl_policies().patch(...).doit().await
let r = hub.region_target_http_proxies().delete(...).doit().await
let r = hub.region_target_http_proxies().insert(...).doit().await
let r = hub.region_target_http_proxies().set_url_map(...).doit().await
let r = hub.region_target_https_proxies().delete(...).doit().await
let r = hub.region_target_https_proxies().insert(...).doit().await
let r = hub.region_target_https_proxies().patch(...).doit().await
let r = hub.region_target_https_proxies().set_ssl_certificates(...).doit().await
let r = hub.region_target_https_proxies().set_url_map(...).doit().await
let r = hub.region_target_tcp_proxies().delete(...).doit().await
let r = hub.region_target_tcp_proxies().insert(...).doit().await
let r = hub.region_url_maps().delete(...).doit().await
let r = hub.region_url_maps().insert(...).doit().await
let r = hub.region_url_maps().patch(...).doit().await
let r = hub.region_url_maps().update(...).doit().await
let r = hub.reservations().delete(...).doit().await
let r = hub.reservations().insert(...).doit().await
let r = hub.reservations().resize(...).doit().await
let r = hub.reservations().update(...).doit().await
let r = hub.resource_policies().delete(...).doit().await
let r = hub.resource_policies().insert(...).doit().await
let r = hub.resource_policies().patch(...).doit().await
let r = hub.routers().delete(...).doit().await
let r = hub.routers().insert(...).doit().await
let r = hub.routers().patch(...).doit().await
let r = hub.routers().update(...).doit().await
let r = hub.routes().delete(...).doit().await
let r = hub.routes().insert(...).doit().await
let r = hub.security_policies().add_rule(...).doit().await
let r = hub.security_policies().delete(...).doit().await
let r = hub.security_policies().insert(...).doit().await
let r = hub.security_policies().patch(...).doit().await
let r = hub.security_policies().patch_rule(...).doit().await
let r = hub.security_policies().remove_rule(...).doit().await
let r = hub.security_policies().set_labels(...).doit().await
let r = hub.service_attachments().delete(...).doit().await
let r = hub.service_attachments().insert(...).doit().await
let r = hub.service_attachments().patch(...).doit().await
let r = hub.snapshot_settings().patch(...).doit().await
let r = hub.snapshots().delete(...).doit().await
let r = hub.snapshots().insert(...).doit().await
let r = hub.snapshots().set_labels(...).doit().await
let r = hub.ssl_certificates().delete(...).doit().await
let r = hub.ssl_certificates().insert(...).doit().await
let r = hub.ssl_policies().delete(...).doit().await
let r = hub.ssl_policies().insert(...).doit().await
let r = hub.ssl_policies().patch(...).doit().await
let r = hub.storage_pools().delete(...).doit().await
let r = hub.storage_pools().insert(...).doit().await
let r = hub.storage_pools().update(...).doit().await
let r = hub.subnetworks().delete(...).doit().await
let r = hub.subnetworks().expand_ip_cidr_range(...).doit().await
let r = hub.subnetworks().insert(...).doit().await
let r = hub.subnetworks().patch(...).doit().await
let r = hub.subnetworks().set_private_ip_google_access(...).doit().await
let r = hub.target_grpc_proxies().delete(...).doit().await
let r = hub.target_grpc_proxies().insert(...).doit().await
let r = hub.target_grpc_proxies().patch(...).doit().await
let r = hub.target_http_proxies().delete(...).doit().await
let r = hub.target_http_proxies().insert(...).doit().await
let r = hub.target_http_proxies().patch(...).doit().await
let r = hub.target_http_proxies().set_url_map(...).doit().await
let r = hub.target_https_proxies().delete(...).doit().await
let r = hub.target_https_proxies().insert(...).doit().await
let r = hub.target_https_proxies().patch(...).doit().await
let r = hub.target_https_proxies().set_certificate_map(...).doit().await
let r = hub.target_https_proxies().set_quic_override(...).doit().await
let r = hub.target_https_proxies().set_ssl_certificates(...).doit().await
let r = hub.target_https_proxies().set_ssl_policy(...).doit().await
let r = hub.target_https_proxies().set_url_map(...).doit().await
let r = hub.target_instances().delete(...).doit().await
let r = hub.target_instances().insert(...).doit().await
let r = hub.target_instances().set_security_policy(...).doit().await
let r = hub.target_pools().add_health_check(...).doit().await
let r = hub.target_pools().add_instance(...).doit().await
let r = hub.target_pools().delete(...).doit().await
let r = hub.target_pools().insert(...).doit().await
let r = hub.target_pools().remove_health_check(...).doit().await
let r = hub.target_pools().remove_instance(...).doit().await
let r = hub.target_pools().set_backup(...).doit().await
let r = hub.target_pools().set_security_policy(...).doit().await
let r = hub.target_ssl_proxies().delete(...).doit().await
let r = hub.target_ssl_proxies().insert(...).doit().await
let r = hub.target_ssl_proxies().set_backend_service(...).doit().await
let r = hub.target_ssl_proxies().set_certificate_map(...).doit().await
let r = hub.target_ssl_proxies().set_proxy_header(...).doit().await
let r = hub.target_ssl_proxies().set_ssl_certificates(...).doit().await
let r = hub.target_ssl_proxies().set_ssl_policy(...).doit().await
let r = hub.target_tcp_proxies().delete(...).doit().await
let r = hub.target_tcp_proxies().insert(...).doit().await
let r = hub.target_tcp_proxies().set_backend_service(...).doit().await
let r = hub.target_tcp_proxies().set_proxy_header(...).doit().await
let r = hub.target_vpn_gateways().delete(...).doit().await
let r = hub.target_vpn_gateways().insert(...).doit().await
let r = hub.target_vpn_gateways().set_labels(...).doit().await
let r = hub.url_maps().delete(...).doit().await
let r = hub.url_maps().insert(...).doit().await
let r = hub.url_maps().invalidate_cache(...).doit().await
let r = hub.url_maps().patch(...).doit().await
let r = hub.url_maps().update(...).doit().await
let r = hub.vpn_gateways().delete(...).doit().await
let r = hub.vpn_gateways().insert(...).doit().await
let r = hub.vpn_gateways().set_labels(...).doit().await
let r = hub.vpn_tunnels().delete(...).doit().await
let r = hub.vpn_tunnels().insert(...).doit().await
let r = hub.vpn_tunnels().set_labels(...).doit().await
let r = hub.zone_operations().get(...).doit().await
let r = hub.zone_operations().wait(...).doit().await
The resource()
and activity(...)
calls create builders. The second one dealing with Activities
supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
specified right away (i.e. (...)
), whereas all optional ones can be build up as desired.
The doit()
method performs the actual communication with the server and returns the respective result.
Usage
Setting up your Project
To use this library, you would put the following lines into your Cargo.toml
file:
[dependencies]
google-compute1 = "*"
serde = "1"
serde_json = "1"
A complete example
extern crate hyper;
extern crate hyper_rustls;
extern crate google_compute1 as compute1;
use compute1::api::Disk;
use compute1::{Result, Error};
use compute1::{Compute, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
// Get an ApplicationSecret instance by some means. It contains the `client_id` and
// `client_secret`, among other things.
let secret: yup_oauth2::ApplicationSecret = Default::default();
// Instantiate the authenticator. It will choose a suitable authentication flow for you,
// unless you replace `None` with the desired Flow.
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
// retrieve them from storage.
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = Compute::new(client, auth);
// As the method needs a request, you would usually fill it with the desired information
// into the respective structure. Some of the parts shown here might not be applicable !
// Values shown here are possibly random and not representative !
let mut req = Disk::default();
// You can configure optional parameters by calling the respective setters at will, and
// execute the final call using `doit()`.
// Values shown here are possibly random and not representative !
let result = hub.disks().update(req, "project", "zone", "disk")
.update_mask(FieldMask::new::<&str>(&[]))
.request_id("ipsum")
.add_paths("voluptua.")
.doit().await;
match result {
Err(e) => match e {
// The Error enum provides details about what exactly happened.
// You can also just use its `Debug`, `Display` or `Error` traits
Error::HttpError(_)
|Error::Io(_)
|Error::MissingAPIKey
|Error::MissingToken(_)
|Error::Cancelled
|Error::UploadSizeLimitExceeded(_, _)
|Error::Failure(_)
|Error::BadRequest(_)
|Error::FieldClash(_)
|Error::JsonDecodeError(_, _) => println!("{}", e),
},
Ok(res) => println!("Success: {:?}", res),
}
Handling Errors
All errors produced by the system are provided either as Result enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the Hub Delegate, or the Authenticator Delegate.
When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors.
Uploads and Downloads
If a method supports downloads, the response body, which is part of the Result, should be
read by you to obtain the media.
If such a method also supports a Response Result, it will return that by default.
You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
this call: .param("alt", "media")
.
Methods supporting uploads can do so using up to 2 different protocols:
simple and resumable. The distinctiveness of each is represented by customized
doit(...)
methods, which are then named upload(...)
and upload_resumable(...)
respectively.
Customization and Callbacks
You may alter the way an doit()
method is called by providing a delegate to the
Method Builder before making the final doit()
call.
Respective methods will be called to provide progress information, as well as determine whether the system should
retry on failure.
The delegate trait is default-implemented, allowing you to customize it with minimal effort.
Optional Parts in Server-Requests
All structures provided by this library are made to be encodable and decodable via json. Optionals are used to indicate that partial requests are responses are valid. Most optionals are are considered Parts which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response.
Builder Arguments
Using method builders, you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true.
- PODs are handed by copy
- strings are passed as
&str
- request values are moved
Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
Cargo Features
utoipa
- Add support for utoipa and deriveutoipa::ToSchema
on all the types. You'll have to import and register the required types in#[openapi(schemas(...))]
, otherwise the generatedopenapi
spec would be invalid.
License
The compute1 library was generated by Sebastian Thiel, and is placed under the MIT license. You can read the full text at the repository's license file.
Dependencies
~20–31MB
~568K SLoC