Пример #1
0
        /// <summary>Snippet for Insert</summary>
        public void Insert()
        {
            // Snippet: Insert(string, string, NodeTemplate, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string       project = "";
            string       region  = "";
            NodeTemplate nodeTemplateResource = new NodeTemplate();
            // Make the request
            lro::Operation <Operation, Operation> response = nodeTemplatesClient.Insert(project, region, nodeTemplateResource);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation <Operation, Operation> retrievedResponse = nodeTemplatesClient.PollOnceInsert(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
Пример #2
0
        /// <summary>Snippet for Delete</summary>
        public void DeleteRequestObject()
        {
            // Snippet: Delete(DeleteNodeTemplateRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            DeleteNodeTemplateRequest request = new DeleteNodeTemplateRequest
            {
                RequestId    = "",
                Region       = "",
                Project      = "",
                NodeTemplate = "",
            };
            // Make the request
            lro::Operation <Operation, Operation> response = nodeTemplatesClient.Delete(request);

            // Poll until the returned long-running operation is complete
            lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Operation result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            lro::Operation <Operation, Operation> retrievedResponse = nodeTemplatesClient.PollOnceDelete(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Operation retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedList()
 {
     // Snippet: AggregatedList(string, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     string project = "";
     // Make the request
     NodeTemplateAggregatedList response = nodeTemplatesClient.AggregatedList(project);
     // End snippet
 }
Пример #4
0
 /// <summary>Snippet for Insert</summary>
 public void Insert()
 {
     // Snippet: Insert(string, string, NodeTemplate, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     string       project = "";
     string       region  = "";
     NodeTemplate nodeTemplateResource = new NodeTemplate();
     // Make the request
     Operation response = nodeTemplatesClient.Insert(project, region, nodeTemplateResource);
     // End snippet
 }
Пример #5
0
 /// <summary>Snippet for Delete</summary>
 public void Delete()
 {
     // Snippet: Delete(string, string, string, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     string project      = "";
     string region       = "";
     string nodeTemplate = "";
     // Make the request
     Operation response = nodeTemplatesClient.Delete(project, region, nodeTemplate);
     // End snippet
 }
Пример #6
0
 /// <summary>Snippet for GetIamPolicy</summary>
 public void GetIamPolicy()
 {
     // Snippet: GetIamPolicy(string, string, string, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     // Make the request
     Policy response = nodeTemplatesClient.GetIamPolicy(project, region, resource);
     // End snippet
 }
Пример #7
0
        /// <summary>Snippet for List</summary>
        public void ListRequestObject()
        {
            // Snippet: List(ListNodeTemplatesRequest, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            ListNodeTemplatesRequest request = new ListNodeTemplatesRequest
            {
                Region  = "",
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedEnumerable <NodeTemplateList, NodeTemplate> response = nodeTemplatesClient.List(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (NodeTemplate 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 (NodeTemplateList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (NodeTemplate 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 <NodeTemplate> 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 (NodeTemplate 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
        }
Пример #8
0
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissions()
 {
     // Snippet: TestIamPermissions(string, string, string, TestPermissionsRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     string project  = "";
     string region   = "";
     string resource = "";
     TestPermissionsRequest testPermissionsRequestResource = new TestPermissionsRequest();
     // Make the request
     TestPermissionsResponse response = nodeTemplatesClient.TestIamPermissions(project, region, resource, testPermissionsRequestResource);
     // End snippet
 }
Пример #9
0
 /// <summary>Snippet for Get</summary>
 public void GetRequestObject()
 {
     // Snippet: Get(GetNodeTemplateRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     GetNodeTemplateRequest request = new GetNodeTemplateRequest
     {
         Region       = "",
         Project      = "",
         NodeTemplate = "",
     };
     // Make the request
     NodeTemplate response = nodeTemplatesClient.Get(request);
     // End snippet
 }
Пример #10
0
 /// <summary>Snippet for TestIamPermissions</summary>
 public void TestIamPermissionsRequestObject()
 {
     // Snippet: TestIamPermissions(TestIamPermissionsNodeTemplateRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     TestIamPermissionsNodeTemplateRequest request = new TestIamPermissionsNodeTemplateRequest
     {
         Region   = "",
         Resource = "",
         Project  = "",
         TestPermissionsRequestResource = new TestPermissionsRequest(),
     };
     // Make the request
     TestPermissionsResponse response = nodeTemplatesClient.TestIamPermissions(request);
     // End snippet
 }
Пример #11
0
 /// <summary>Snippet for SetIamPolicy</summary>
 public void SetIamPolicyRequestObject()
 {
     // Snippet: SetIamPolicy(SetIamPolicyNodeTemplateRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     SetIamPolicyNodeTemplateRequest request = new SetIamPolicyNodeTemplateRequest
     {
         Region   = "",
         Resource = "",
         Project  = "",
         RegionSetPolicyRequestResource = new RegionSetPolicyRequest(),
     };
     // Make the request
     Policy response = nodeTemplatesClient.SetIamPolicy(request);
     // End snippet
 }
Пример #12
0
 /// <summary>Snippet for Delete</summary>
 public void DeleteRequestObject()
 {
     // Snippet: Delete(DeleteNodeTemplateRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     DeleteNodeTemplateRequest request = new DeleteNodeTemplateRequest
     {
         RequestId    = "",
         Region       = "",
         Project      = "",
         NodeTemplate = "",
     };
     // Make the request
     Operation response = nodeTemplatesClient.Delete(request);
     // End snippet
 }
Пример #13
0
 /// <summary>Snippet for Insert</summary>
 public void InsertRequestObject()
 {
     // Snippet: Insert(InsertNodeTemplateRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     InsertNodeTemplateRequest request = new InsertNodeTemplateRequest
     {
         RequestId            = "",
         NodeTemplateResource = new NodeTemplate(),
         Region  = "",
         Project = "",
     };
     // Make the request
     Operation response = nodeTemplatesClient.Insert(request);
     // End snippet
 }
Пример #14
0
 /// <summary>Snippet for GetIamPolicy</summary>
 public void GetIamPolicyRequestObject()
 {
     // Snippet: GetIamPolicy(GetIamPolicyNodeTemplateRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     GetIamPolicyNodeTemplateRequest request = new GetIamPolicyNodeTemplateRequest
     {
         Region   = "",
         Resource = "",
         Project  = "",
         OptionsRequestedPolicyVersion = 0,
     };
     // Make the request
     Policy response = nodeTemplatesClient.GetIamPolicy(request);
     // End snippet
 }
Пример #15
0
        /// <summary>Snippet for AggregatedList</summary>
        public void AggregatedList()
        {
            // Snippet: AggregatedList(string, string, int?, CallSettings)
            // Create client
            NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
            // Initialize request argument(s)
            string project = "";
            // Make the request
            PagedEnumerable <NodeTemplateAggregatedList, KeyValuePair <string, NodeTemplatesScopedList> > response = nodeTemplatesClient.AggregatedList(project);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (KeyValuePair <string, NodeTemplatesScopedList> 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 (NodeTemplateAggregatedList page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (KeyValuePair <string, NodeTemplatesScopedList> 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 <KeyValuePair <string, NodeTemplatesScopedList> > 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 (KeyValuePair <string, NodeTemplatesScopedList> 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
        }
 /// <summary>Snippet for AggregatedList</summary>
 public void AggregatedListRequestObject()
 {
     // Snippet: AggregatedList(AggregatedListNodeTemplatesRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     AggregatedListNodeTemplatesRequest request = new AggregatedListNodeTemplatesRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         IncludeAllScopes     = false,
         ReturnPartialSuccess = false,
     };
     // Make the request
     NodeTemplateAggregatedList response = nodeTemplatesClient.AggregatedList(request);
     // End snippet
 }
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListNodeTemplatesRequest, CallSettings)
     // Create client
     NodeTemplatesClient nodeTemplatesClient = NodeTemplatesClient.Create();
     // Initialize request argument(s)
     ListNodeTemplatesRequest request = new ListNodeTemplatesRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Region               = "",
         OrderBy              = "",
         Project              = "",
         Filter               = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     NodeTemplateList response = nodeTemplatesClient.List(request);
     // End snippet
 }