Example #1
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedList()
 {
     // Snippet: AggregatedList(string, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     InstanceGroupAggregatedList response = instanceGroupsClient.AggregatedList(project);
     // End snippet
 }
Example #2
0
 /// <summary>Snippet for List</summary>
 public void List()
 {
     // Snippet: List(string, string, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     string project = "";
     string zone    = "";
     // Make the request
     InstanceGroupList response = instanceGroupsClient.List(project, zone);
     // End snippet
 }
        /// <summary>Snippet for ListInstances</summary>
        public void ListInstancesRequestObject()
        {
            // Snippet: ListInstances(ListInstancesInstanceGroupsRequest, CallSettings)
            // Create client
            InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
            // Initialize request argument(s)
            ListInstancesInstanceGroupsRequest request = new ListInstancesInstanceGroupsRequest
            {
                Zone          = "",
                InstanceGroup = "",
                OrderBy       = "",
                Project       = "",
                Filter        = "",
                InstanceGroupsListInstancesRequestResource = new InstanceGroupsListInstancesRequest(),
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <InstanceGroupsListInstances, InstanceWithNamedPorts> response = instanceGroupsClient.ListInstances(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (InstanceWithNamedPorts item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (InstanceGroupsListInstances page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (InstanceWithNamedPorts item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <InstanceWithNamedPorts> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (InstanceWithNamedPorts item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
Example #4
0
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, InstanceGroup, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     string        project = "";
     string        zone    = "";
     InstanceGroup instanceGroupResource = new InstanceGroup();
     // Make the request
     Operation response = instanceGroupsClient.Insert(project, zone, instanceGroupResource);
     // End snippet
 }
Example #5
0
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, string, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     string project       = "";
     string zone          = "";
     string instanceGroup = "";
     // Make the request
     Operation response = instanceGroupsClient.Delete(project, zone, instanceGroup);
     // End snippet
 }
Example #6
0
 /// <summary>Snippet for SetNamedPorts</summary>
 public void SetNamedPorts()
 {
     // Snippet: SetNamedPorts(string, string, string, InstanceGroupsSetNamedPortsRequest, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     string project       = "";
     string zone          = "";
     string instanceGroup = "";
     InstanceGroupsSetNamedPortsRequest instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest();
     // Make the request
     Operation response = instanceGroupsClient.SetNamedPorts(project, zone, instanceGroup, instanceGroupsSetNamedPortsRequestResource);
     // End snippet
 }
Example #7
0
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetInstanceGroupRequest, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     GetInstanceGroupRequest request = new GetInstanceGroupRequest
     {
         Zone          = "",
         InstanceGroup = "",
         Project       = "",
     };
     // Make the request
     InstanceGroup response = instanceGroupsClient.Get(request);
     // End snippet
 }
Example #8
0
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertInstanceGroupRequest, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     InsertInstanceGroupRequest request = new InsertInstanceGroupRequest
     {
         Zone                  = "",
         RequestId             = "",
         Project               = "",
         InstanceGroupResource = new InstanceGroup(),
     };
     // Make the request
     Operation response = instanceGroupsClient.Insert(request);
     // End snippet
 }
Example #9
0
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteInstanceGroupRequest, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     DeleteInstanceGroupRequest request = new DeleteInstanceGroupRequest
     {
         Zone          = "",
         RequestId     = "",
         InstanceGroup = "",
         Project       = "",
     };
     // Make the request
     Operation response = instanceGroupsClient.Delete(request);
     // End snippet
 }
        /// <summary>Snippet for List</summary>
        public void List()
        {
            // Snippet: List(string, string, string, int?, CallSettings)
            // Create client
            InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
            // Initialize request argument(s)
            string project = "";
            string zone    = "";
            // Make the request
            PagedEnumerable <InstanceGroupList, InstanceGroup> response = instanceGroupsClient.List(project, zone);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (InstanceGroup item in response)
            {
                // Do something with each item
                Console.WriteLine(item);
            }

            // Or iterate over pages (of server-defined size), performing one RPC per page
            foreach (InstanceGroupList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (InstanceGroup item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            }

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <InstanceGroup> singlePage = response.ReadPage(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (InstanceGroup item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
Example #11
0
 /// <summary>Snippet for SetNamedPorts</summary>
 public void SetNamedPortsRequestObject()
 {
     // Snippet: SetNamedPorts(SetNamedPortsInstanceGroupRequest, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     SetNamedPortsInstanceGroupRequest request = new SetNamedPortsInstanceGroupRequest
     {
         Zone          = "",
         RequestId     = "",
         InstanceGroup = "",
         Project       = "",
         InstanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(),
     };
     // Make the request
     Operation response = instanceGroupsClient.SetNamedPorts(request);
     // End snippet
 }
Example #12
0
 /// <summary>Snippet for RemoveInstances</summary>
 public void RemoveInstancesRequestObject()
 {
     // Snippet: RemoveInstances(RemoveInstancesInstanceGroupRequest, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     RemoveInstancesInstanceGroupRequest request = new RemoveInstancesInstanceGroupRequest
     {
         Zone          = "",
         RequestId     = "",
         InstanceGroup = "",
         InstanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(),
         Project = "",
     };
     // Make the request
     Operation response = instanceGroupsClient.RemoveInstances(request);
     // End snippet
 }
Example #13
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListInstanceGroupsRequest, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     ListInstanceGroupsRequest request = new ListInstanceGroupsRequest
     {
         Zone                 = "",
         PageToken            = "",
         MaxResults           = 0U,
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     InstanceGroupList response = instanceGroupsClient.List(request);
     // End snippet
 }
Example #14
0
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedListRequestObject()
 {
     // Snippet: AggregatedList(AggregatedListInstanceGroupsRequest, CallSettings)
     // Create client
     InstanceGroupsClient instanceGroupsClient = InstanceGroupsClient.Create();
     // Initialize request argument(s)
     AggregatedListInstanceGroupsRequest request = new AggregatedListInstanceGroupsRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         IncludeAllScopes     = false,
         ReturnPartialSuccess = false,
     };
     // Make the request
     InstanceGroupAggregatedList response = instanceGroupsClient.AggregatedList(request);
     // End snippet
 }