Beispiel #1
0
        /// <summary>Snippet for DiagnoseCluster</summary>
        public void DiagnoseCluster_RequestObject()
        {
            // Snippet: DiagnoseCluster(DiagnoseClusterRequest,CallSettings)
            // Create client
            ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
            // Initialize request argument(s)
            DiagnoseClusterRequest request = new DiagnoseClusterRequest
            {
                ProjectId   = "",
                Region      = "",
                ClusterName = "",
            };
            // Make the request
            Operation <Empty, DiagnoseClusterResults> response =
                clusterControllerClient.DiagnoseCluster(request);

            // Poll until the returned long-running operation is complete
            Operation <Empty, DiagnoseClusterResults> completedResponse =
                response.PollUntilCompleted();
            // The long-running operation is now complete.

            // 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
            Operation <Empty, DiagnoseClusterResults> retrievedResponse =
                clusterControllerClient.PollOnceDiagnoseCluster(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // The long-running operation is now complete.
            }
            // End snippet
        }
        /// <summary>Snippet for DiagnoseCluster</summary>
        public void DiagnoseCluster()
        {
            // Snippet: DiagnoseCluster(string, string, string, CallSettings)
            // Create client
            ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
            // Initialize request argument(s)
            string projectId   = "";
            string region      = "";
            string clusterName = "";
            // Make the request
            Operation <DiagnoseClusterResults, ClusterOperationMetadata> response = clusterControllerClient.DiagnoseCluster(projectId, region, clusterName);

            // Poll until the returned long-running operation is complete
            Operation <DiagnoseClusterResults, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            DiagnoseClusterResults 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
            Operation <DiagnoseClusterResults, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceDiagnoseCluster(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                DiagnoseClusterResults retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }