/// <summary>
        /// Deletes the specified zone-specific Operations resource.
        /// Documentation https://developers.google.com/compute/v1/reference/zoneOperations/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="zone">Name of the zone for this request.</param>
        /// <param name="operation">Name of the Operations resource to delete.</param>
        public static void Delete(computeService service, string project, string zone, string operation)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (zone == null)
                {
                    throw new ArgumentNullException(zone);
                }
                if (operation == null)
                {
                    throw new ArgumentNullException(operation);
                }

                // Make the request.
                return(service.ZoneOperations.Delete(project, zone, operation).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ZoneOperations.Delete failed.", ex);
            }
        }
        /// <summary>
        /// Creates a ForwardingRule resource in the specified project and region using the data included in the request.
        /// Documentation https://developers.google.com/compute/v1/reference/globalForwardingRules/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="body">A valid compute v1 body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Insert(computeService service, string project, ForwardingRule body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Make the request.
                return(service.GlobalForwardingRules.Insert(body, project).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request GlobalForwardingRules.Insert failed.", ex);
            }
        }
        /// <summary>
        /// Returns the specified ForwardingRule resource. Get a list of available forwarding rules by making a list() request.
        /// Documentation https://developers.google.com/compute/v1/reference/globalForwardingRules/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="forwardingRule">Name of the ForwardingRule resource to return.</param>
        /// <returns>ForwardingRuleResponse</returns>
        public static ForwardingRule Get(computeService service, string project, string forwardingRule)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (forwardingRule == null)
                {
                    throw new ArgumentNullException(forwardingRule);
                }

                // Make the request.
                return(service.GlobalForwardingRules.Get(project, forwardingRule).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request GlobalForwardingRules.Get failed.", ex);
            }
        }
        /// <summary>
        /// Sets the access control policy on the specified resource. Replaces any existing policy.
        /// Documentation https://developers.google.com/compute/alpha/reference/hosts/setIamPolicy
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="zone">The name of the zone for this request.</param>
        /// <param name="resource">Name of the resource for this request.</param>
        /// <param name="body">A valid compute alpha body.</param>
        /// <returns>PolicyResponse</returns>
        public static Policy SetIamPolicy(computeService service, string project, string zone, string resource, Policy body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (zone == null)
                {
                    throw new ArgumentNullException(zone);
                }
                if (resource == null)
                {
                    throw new ArgumentNullException(resource);
                }

                // Make the request.
                return(service.Hosts.SetIamPolicy(body, project, zone, resource).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Hosts.SetIamPolicy failed.", ex);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Returns permissions that a caller has on the specified resource.
        /// Documentation https://developers.google.com/compute/alpha/reference/regionInstanceGroupManagers/testIamPermissions
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">The name of the region for this request.</param>
        /// <param name="resource">Name of the resource for this request.</param>
        /// <param name="body">A valid compute alpha body.</param>
        /// <returns>TestPermissionsResponseResponse</returns>
        public static TestPermissionsResponse TestIamPermissions(computeService service, string project, string region, string resource, TestPermissionsRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }
                if (resource == null)
                {
                    throw new ArgumentNullException(resource);
                }

                // Make the request.
                return(service.RegionInstanceGroupManagers.TestIamPermissions(body, project, region, resource).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request RegionInstanceGroupManagers.TestIamPermissions failed.", ex);
            }
        }
        /// <summary>
        /// Resizes the specified persistent disk.
        /// Documentation https://developers.google.com/compute/v1/reference/disks/resize
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="zone">The name of the zone for this request.</param>
        /// <param name="disk">The name of the persistent disk.</param>
        /// <param name="body">A valid compute v1 body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Resize(computeService service, string project, string zone, string disk, DisksResizeRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (zone == null)
                {
                    throw new ArgumentNullException(zone);
                }
                if (disk == null)
                {
                    throw new ArgumentNullException(disk);
                }

                // Make the request.
                return(service.Disks.Resize(body, project, zone, disk).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Disks.Resize failed.", ex);
            }
        }
        /// <summary>
        /// Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request.
        /// Documentation https://developers.google.com/compute/v1/reference/targetHttpProxies/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="targetHttpProxy">Name of the TargetHttpProxy resource to return.</param>
        /// <returns>TargetHttpProxyResponse</returns>
        public static TargetHttpProxy Get(computeService service, string project, string targetHttpProxy)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (targetHttpProxy == null)
                {
                    throw new ArgumentNullException(targetHttpProxy);
                }

                // Make the request.
                return(service.TargetHttpProxies.Get(project, targetHttpProxy).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetHttpProxies.Get failed.", ex);
            }
        }
        /// <summary>
        /// Returns the specified machine type. Get a list of available machine types by making a list() request.
        /// Documentation https://developers.google.com/compute/v1/reference/machineTypes/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="zone">The name of the zone for this request.</param>
        /// <param name="machineType">Name of the machine type to return.</param>
        /// <returns>MachineTypeResponse</returns>
        public static MachineType Get(computeService service, string project, string zone, string machineType)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (zone == null)
                {
                    throw new ArgumentNullException(zone);
                }
                if (machineType == null)
                {
                    throw new ArgumentNullException(machineType);
                }

                // Make the request.
                return(service.MachineTypes.Get(project, zone, machineType).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request MachineTypes.Get failed.", ex);
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Deletes the specified Route resource.
        /// Documentation https://developers.google.com/compute/beta/reference/routes/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="route">Name of the Route resource to delete.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Delete(computeService service, string project, string route)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (route == null)
                {
                    throw new ArgumentNullException(route);
                }

                // Make the request.
                return(service.Routes.Delete(project, route).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Routes.Delete failed.", ex);
            }
        }
        /// <summary>
        /// Creates a TargetInstance resource in the specified project and zone using the data included in the request.
        /// Documentation https://developers.google.com/compute/v1/reference/targetInstances/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="zone">Name of the zone scoping this request.</param>
        /// <param name="body">A valid compute v1 body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Insert(computeService service, string project, string zone, TargetInstance body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (zone == null)
                {
                    throw new ArgumentNullException(zone);
                }

                // Make the request.
                return(service.TargetInstances.Insert(body, project, zone).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetInstances.Insert failed.", ex);
            }
        }
        /// <summary>
        /// Switches the network mode from auto subnet mode to custom subnet mode.
        /// Documentation https://developers.google.com/compute/beta/reference/networks/switchToCustomMode
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="network">Name of the network to be updated.</param>
        /// <returns>OperationResponse</returns>
        public static Operation SwitchToCustomMode(computeService service, string project, string network)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (network == null)
                {
                    throw new ArgumentNullException(network);
                }

                // Make the request.
                return(service.Networks.SwitchToCustomMode(project, network).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Networks.SwitchToCustomMode failed.", ex);
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read  Restrictions and Guidelines for more information.
        /// Documentation https://developers.google.com/compute/alpha/reference/regionBackendServices/update
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region scoping this request.</param>
        /// <param name="backendService">Name of the BackendService resource to update.</param>
        /// <param name="body">A valid compute alpha body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Update(computeService service, string project, string region, string backendService, BackendService body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }
                if (backendService == null)
                {
                    throw new ArgumentNullException(backendService);
                }

                // Make the request.
                return(service.RegionBackendServices.Update(body, project, region, backendService).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request RegionBackendServices.Update failed.", ex);
            }
        }
        /// <summary>
        /// Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request.
        /// Documentation https://developers.google.com/compute/beta/reference/httpsHealthChecks/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="httpsHealthCheck">Name of the HttpsHealthCheck resource to return.</param>
        /// <returns>HttpsHealthCheckResponse</returns>
        public static HttpsHealthCheck Get(computeService service, string project, string httpsHealthCheck)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (httpsHealthCheck == null)
                {
                    throw new ArgumentNullException(httpsHealthCheck);
                }

                // Make the request.
                return(service.HttpsHealthChecks.Get(project, httpsHealthCheck).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request HttpsHealthChecks.Get failed.", ex);
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Updates the specified BackendBucket resource with the data included in the request. This method supports patch semantics.
        /// Documentation https://developers.google.com/compute/beta/reference/backendBuckets/patch
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="backendBucket">Name of the BackendBucket resource to update.</param>
        /// <param name="body">A valid compute beta body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Patch(computeService service, string project, string backendBucket, BackendBucket body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (backendBucket == null)
                {
                    throw new ArgumentNullException(backendBucket);
                }

                // Make the request.
                return(service.BackendBuckets.Patch(body, project, backendBucket).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request BackendBuckets.Patch failed.", ex);
            }
        }
        /// <summary>
        /// Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
        /// Documentation https://developers.google.com/compute/beta/reference/urlMaps/invalidateCache
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="urlMap">Name of the UrlMap scoping this request.</param>
        /// <param name="body">A valid compute beta body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation InvalidateCache(computeService service, string project, string urlMap, CacheInvalidationRule body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (urlMap == null)
                {
                    throw new ArgumentNullException(urlMap);
                }

                // Make the request.
                return(service.UrlMaps.InvalidateCache(body, project, urlMap).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request UrlMaps.InvalidateCache failed.", ex);
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Sets the labels on a snapshot. To learn more about labels, read the Labeling or Tagging Resources documentation.
        /// Documentation https://developers.google.com/compute/beta/reference/snapshots/setLabels
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="resource">Name of the resource for this request.</param>
        /// <param name="body">A valid compute beta body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation SetLabels(computeService service, string project, string resource, GlobalSetLabelsRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (resource == null)
                {
                    throw new ArgumentNullException(resource);
                }

                // Make the request.
                return(service.Snapshots.SetLabels(body, project, resource).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Snapshots.SetLabels failed.", ex);
            }
        }
        /// <summary>
        /// Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request.
        /// Documentation https://developers.google.com/compute/beta/reference/urlMaps/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="urlMap">Name of the UrlMap resource to return.</param>
        /// <returns>UrlMapResponse</returns>
        public static UrlMap Get(computeService service, string project, string urlMap)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (urlMap == null)
                {
                    throw new ArgumentNullException(urlMap);
                }

                // Make the request.
                return(service.UrlMaps.Get(project, urlMap).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request UrlMaps.Get failed.", ex);
            }
        }
Esempio n. 18
0
        /// <summary>
        /// Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request.
        /// Documentation https://developers.google.com/compute/beta/reference/snapshots/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="snapshot">Name of the Snapshot resource to return.</param>
        /// <returns>SnapshotResponse</returns>
        public static Snapshot Get(computeService service, string project, string snapshot)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (snapshot == null)
                {
                    throw new ArgumentNullException(snapshot);
                }

                // Make the request.
                return(service.Snapshots.Get(project, snapshot).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Snapshots.Get failed.", ex);
            }
        }
        /// <summary>
        /// Changes the URL map for TargetHttpProxy.
        /// Documentation https://developers.google.com/compute/v1/reference/targetHttpProxies/setUrlMap
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="targetHttpProxy">Name of the TargetHttpProxy to set a URL map for.</param>
        /// <param name="body">A valid compute v1 body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation SetUrlMap(computeService service, string project, string targetHttpProxy, UrlMapReference body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (targetHttpProxy == null)
                {
                    throw new ArgumentNullException(targetHttpProxy);
                }

                // Make the request.
                return(service.TargetHttpProxies.SetUrlMap(body, project, targetHttpProxy).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetHttpProxies.SetUrlMap failed.", ex);
            }
        }
        /// <summary>
        /// Deletes the specified autoscaler.
        /// Documentation https://developers.google.com/compute/v1/reference/regionAutoscalers/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region scoping this request.</param>
        /// <param name="autoscaler">Name of the autoscaler to delete.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Delete(computeService service, string project, string region, string autoscaler)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }
                if (autoscaler == null)
                {
                    throw new ArgumentNullException(autoscaler);
                }

                // Make the request.
                return(service.RegionAutoscalers.Delete(project, region, autoscaler).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request RegionAutoscalers.Delete failed.", ex);
            }
        }
Esempio n. 21
0
        /// <summary>
        /// Returns the specified host. Get a list of available hosts by making a list() request.
        /// Documentation https://developers.google.com/compute/alpha/reference/hosts/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="zone">The name of the zone for this request.</param>
        /// <param name="host">Name of the host to return.</param>
        /// <returns>HostResponse</returns>
        public static Host Get(computeService service, string project, string zone, string host)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (zone == null)
                {
                    throw new ArgumentNullException(zone);
                }
                if (host == null)
                {
                    throw new ArgumentNullException(host);
                }

                // Make the request.
                return(service.Hosts.Get(project, zone, host).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Hosts.Get failed.", ex);
            }
        }
        /// <summary>
        /// Returns the specified subnetwork. Get a list of available subnetworks list() request.
        /// Documentation https://developers.google.com/compute/v1/reference/subnetworks/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region scoping this request.</param>
        /// <param name="subnetwork">Name of the Subnetwork resource to return.</param>
        /// <returns>SubnetworkResponse</returns>
        public static Subnetwork Get(computeService service, string project, string region, string subnetwork)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }
                if (subnetwork == null)
                {
                    throw new ArgumentNullException(subnetwork);
                }

                // Make the request.
                return(service.Subnetworks.Get(project, region, subnetwork).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Subnetworks.Get failed.", ex);
            }
        }
Esempio n. 23
0
        /// <summary>
        /// Retrieves the list of managed instance groups that are contained within the specified region.
        /// Documentation https://developers.google.com/compute/alpha/reference/regionInstanceGroupManagers/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region scoping this request.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>RegionInstanceGroupManagerListResponse</returns>
        public static RegionInstanceGroupManagerList List(computeService service, string project, string region, RegionInstanceGroupManagersListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }

                // Building the initial request.
                var request = service.RegionInstanceGroupManagers.List(project, region);

                // Applying optional parameters to the request.
                request = (RegionInstanceGroupManagersResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request RegionInstanceGroupManagers.List failed.", ex);
            }
        }
        /// <summary>
        /// Creates a subnetwork in the specified project using the data included in the request.
        /// Documentation https://developers.google.com/compute/v1/reference/subnetworks/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region scoping this request.</param>
        /// <param name="body">A valid compute v1 body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Insert(computeService service, string project, string region, Subnetwork body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }

                // Make the request.
                return(service.Subnetworks.Insert(body, project, region).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Subnetworks.Insert failed.", ex);
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listmanagedinstances method.
        /// Documentation https://developers.google.com/compute/alpha/reference/regionInstanceGroupManagers/update
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region scoping this request.</param>
        /// <param name="instanceGroupManager">The name of the instance group manager.</param>
        /// <param name="body">A valid compute alpha body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Update(computeService service, string project, string region, string instanceGroupManager, InstanceGroupManager body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }
                if (instanceGroupManager == null)
                {
                    throw new ArgumentNullException(instanceGroupManager);
                }

                // Make the request.
                return(service.RegionInstanceGroupManagers.Update(body, project, region, instanceGroupManager).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request RegionInstanceGroupManagers.Update failed.", ex);
            }
        }
        /// <summary>
        /// Retrieves an aggregated list of subnetworks.
        /// Documentation https://developers.google.com/compute/v1/reference/subnetworks/aggregatedList
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>SubnetworkAggregatedListResponse</returns>
        public static SubnetworkAggregatedList AggregatedList(computeService service, string project, SubnetworksAggregatedListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Building the initial request.
                var request = service.Subnetworks.AggregatedList(project);

                // Applying optional parameters to the request.
                request = (SubnetworksResource.AggregatedListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Subnetworks.AggregatedList failed.", ex);
            }
        }
        /// <summary>
        /// Retrieves a list of ForwardingRule resources available to the specified project.
        /// Documentation https://developers.google.com/compute/v1/reference/globalForwardingRules/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ForwardingRuleListResponse</returns>
        public static ForwardingRuleList List(computeService service, string project, GlobalForwardingRulesListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Building the initial request.
                var request = service.GlobalForwardingRules.List(project);

                // Applying optional parameters to the request.
                request = (GlobalForwardingRulesResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request GlobalForwardingRules.List failed.", ex);
            }
        }
        /// <summary>
        /// Returns the specified address resource. Get a list of available addresses by making a list() request.
        /// Documentation https://developers.google.com/compute/v1/reference/globalAddresses/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="address">Name of the address resource to return.</param>
        /// <returns>AddressResponse</returns>
        public static Address Get(computeService service, string project, string address)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (address == null)
                {
                    throw new ArgumentNullException(address);
                }

                // Make the request.
                return(service.GlobalAddresses.Get(project, address).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request GlobalAddresses.Get failed.", ex);
            }
        }
Esempio n. 29
0
        /// <summary>
        /// Returns the specified Router resource. Get a list of available routers by making a list() request.
        /// Documentation https://developers.google.com/compute/beta/reference/routers/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region for this request.</param>
        /// <param name="router">Name of the Router resource to return.</param>
        /// <returns>RouterResponse</returns>
        public static Router Get(computeService service, string project, string region, string router)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }
                if (router == null)
                {
                    throw new ArgumentNullException(router);
                }

                // Make the request.
                return(service.Routers.Get(project, region, router).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Routers.Get failed.", ex);
            }
        }
        /// <summary>
        /// Disable an XPN resource associated with this host project.
        /// Documentation https://developers.google.com/compute/alpha/reference/projects/disableXpnResource
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="body">A valid compute alpha body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation DisableXpnResource(computeService service, string project, ProjectsDisableXpnResourceRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }

                // Make the request.
                return(service.Projects.DisableXpnResource(body, project).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Projects.DisableXpnResource failed.", ex);
            }
        }