Exemplo n.º 1
0
 /// <summary>Snippet for ListNetworkEndpoints</summary>
 public void ListNetworkEndpoints()
 {
     // Snippet: ListNetworkEndpoints(string, string, string, NetworkEndpointGroupsListEndpointsRequest, CallSettings)
     // Create client
     NetworkEndpointGroupsClient networkEndpointGroupsClient = NetworkEndpointGroupsClient.Create();
     // Initialize request argument(s)
     string project = "";
     string zone    = "";
     string networkEndpointGroup = "";
     NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource = new NetworkEndpointGroupsListEndpointsRequest();
     // Make the request
     NetworkEndpointGroupsListNetworkEndpoints response = networkEndpointGroupsClient.ListNetworkEndpoints(project, zone, networkEndpointGroup, networkEndpointGroupsListEndpointsRequestResource);
     // End snippet
 }
Exemplo n.º 2
0
        /// <summary>Snippet for ListNetworkEndpointsAsync</summary>
        public async Task ListNetworkEndpointsAsync()
        {
            // Snippet: ListNetworkEndpointsAsync(string, string, string, NetworkEndpointGroupsListEndpointsRequest, CallSettings)
            // Additional: ListNetworkEndpointsAsync(string, string, string, NetworkEndpointGroupsListEndpointsRequest, CancellationToken)
            // Create client
            NetworkEndpointGroupsClient networkEndpointGroupsClient = await NetworkEndpointGroupsClient.CreateAsync();

            // Initialize request argument(s)
            string project = "";
            string zone    = "";
            string networkEndpointGroup = "";
            NetworkEndpointGroupsListEndpointsRequest networkEndpointGroupsListEndpointsRequestResource = new NetworkEndpointGroupsListEndpointsRequest();
            // Make the request
            NetworkEndpointGroupsListNetworkEndpoints response = await networkEndpointGroupsClient.ListNetworkEndpointsAsync(project, zone, networkEndpointGroup, networkEndpointGroupsListEndpointsRequestResource);

            // End snippet
        }
        /// <summary>
        /// List the network endpoints in the specified network endpoint group.
        /// Documentation https://developers.google.com/compute/alpha/reference/networkEndpointGroups/listNetworkEndpoints
        /// 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 where the network endpoint group is located. It should comply with RFC1035.</param>
        /// <param name="networkEndpointGroup">The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035.</param>
        /// <param name="body">A valid Compute alpha body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>NetworkEndpointGroupsListNetworkEndpointsResponse</returns>
        public static NetworkEndpointGroupsListNetworkEndpoints ListNetworkEndpoints(ComputeService service, string project, string zone, string networkEndpointGroup, NetworkEndpointGroupsListEndpointsRequest body, NetworkEndpointGroupsListNetworkEndpointsOptionalParms optional = null)
        {
            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 (networkEndpointGroup == null)
                {
                    throw new ArgumentNullException(networkEndpointGroup);
                }

                // Building the initial request.
                var request = service.NetworkEndpointGroups.ListNetworkEndpoints(body, project, zone, networkEndpointGroup);

                // Applying optional parameters to the request.
                request = (NetworkEndpointGroupsResource.ListNetworkEndpointsRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request NetworkEndpointGroups.ListNetworkEndpoints failed.", ex);
            }
        }