/// <summary>Snippet for CreateService</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void CreateService()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
            // Initialize request argument(s)
            ManagedService service = new ManagedService();
            // Make the request
            Operation <ManagedService, OperationMetadata> response = serviceManagerClient.CreateService(service);

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

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                ManagedService retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for SubmitConfigSource</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void SubmitConfigSource()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
            // Initialize request argument(s)
            string       serviceName  = "";
            ConfigSource configSource = new ConfigSource();
            bool         validateOnly = false;
            // Make the request
            Operation <SubmitConfigSourceResponse, OperationMetadata> response = serviceManagerClient.SubmitConfigSource(serviceName, configSource, validateOnly);

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

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                SubmitConfigSourceResponse retrievedResult = retrievedResponse.Result;
            }
        }
        /// <summary>Snippet for EnableService</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void EnableService()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
            // Initialize request argument(s)
            string serviceName = "";
            string consumerId  = "";

            // Make the request
#pragma warning disable CS0612
            Operation <EnableServiceResponse, OperationMetadata> response = serviceManagerClient.EnableService(serviceName, consumerId);
#pragma warning restore CS0612

            // Poll until the returned long-running operation is complete
            Operation <EnableServiceResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            EnableServiceResponse 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
#pragma warning disable CS0612
            Operation <EnableServiceResponse, OperationMetadata> retrievedResponse = serviceManagerClient.PollOnceEnableService(operationName);
#pragma warning restore CS0612
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                EnableServiceResponse retrievedResult = retrievedResponse.Result;
            }
        }
 /// <summary>Snippet for GetService</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetService()
 {
     // Create client
     ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
     // Initialize request argument(s)
     string serviceName = "";
     // Make the request
     ManagedService response = serviceManagerClient.GetService(serviceName);
 }
 /// <summary>Snippet for GenerateConfigReport</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GenerateConfigReport()
 {
     // Create client
     ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
     // Initialize request argument(s)
     Any newConfig = new Any();
     Any oldConfig = new Any();
     // Make the request
     GenerateConfigReportResponse response = serviceManagerClient.GenerateConfigReport(newConfig, oldConfig);
 }
Beispiel #6
0
 /// <summary>Snippet for CreateServiceConfig</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void CreateServiceConfig()
 {
     // Create client
     ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
     // Initialize request argument(s)
     string  serviceName   = "";
     Service serviceConfig = new Service();
     // Make the request
     Service response = serviceManagerClient.CreateServiceConfig(serviceName, serviceConfig);
 }
 /// <summary>Snippet for GetServiceRollout</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetServiceRollout()
 {
     // Create client
     ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
     // Initialize request argument(s)
     string serviceName = "";
     string rolloutId   = "";
     // Make the request
     Rollout response = serviceManagerClient.GetServiceRollout(serviceName, rolloutId);
 }
Beispiel #8
0
 /// <summary>Snippet for GetService</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetServiceRequestObject()
 {
     // Create client
     ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
     // Initialize request argument(s)
     GetServiceRequest request = new GetServiceRequest {
         ServiceName = "",
     };
     // Make the request
     ManagedService response = serviceManagerClient.GetService(request);
 }
        /// <summary>Snippet for GetServiceConfig</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void GetServiceConfig()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
            // Initialize request argument(s)
            string serviceName = "";
            string configId    = "";

            GetServiceConfigRequest.Types.ConfigView view = GetServiceConfigRequest.Types.ConfigView.Basic;
            // Make the request
            Service response = serviceManagerClient.GetServiceConfig(serviceName, configId, view);
        }
 /// <summary>Snippet for GenerateConfigReport</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GenerateConfigReportRequestObject()
 {
     // Create client
     ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
     // Initialize request argument(s)
     GenerateConfigReportRequest request = new GenerateConfigReportRequest
     {
         NewConfig = new Any(),
         OldConfig = new Any(),
     };
     // Make the request
     GenerateConfigReportResponse response = serviceManagerClient.GenerateConfigReport(request);
 }
Beispiel #11
0
 /// <summary>Snippet for CreateServiceConfig</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void CreateServiceConfigRequestObject()
 {
     // Create client
     ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
     // Initialize request argument(s)
     CreateServiceConfigRequest request = new CreateServiceConfigRequest
     {
         ServiceName   = "",
         ServiceConfig = new Service(),
     };
     // Make the request
     Service response = serviceManagerClient.CreateServiceConfig(request);
 }
 /// <summary>Snippet for GetServiceConfig</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetServiceConfigRequestObject()
 {
     // Create client
     ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
     // Initialize request argument(s)
     GetServiceConfigRequest request = new GetServiceConfigRequest
     {
         ServiceName = "",
         ConfigId    = "",
         View        = GetServiceConfigRequest.Types.ConfigView.Basic,
     };
     // Make the request
     Service response = serviceManagerClient.GetServiceConfig(request);
 }
        /// <summary>Snippet for ListServiceRollouts</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ListServiceRolloutsRequestObject()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
            // Initialize request argument(s)
            ListServiceRolloutsRequest request = new ListServiceRolloutsRequest
            {
                ServiceName = "",
                Filter      = "",
            };
            // Make the request
            PagedEnumerable <ListServiceRolloutsResponse, Rollout> response = serviceManagerClient.ListServiceRollouts(request);

            // Iterate over all response items, lazily performing RPCs as required
            foreach (Rollout 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 (ListServiceRolloutsResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (Rollout 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 <Rollout> 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 (Rollout 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;
        }
        /// <summary>Snippet for ListServices</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void ListServices()
        {
            // Create client
            ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
            // Initialize request argument(s)
            string producerProjectId = "";
            string consumerId        = "";

            // Make the request
#pragma warning disable CS0612
            PagedEnumerable <ListServicesResponse, ManagedService> response = serviceManagerClient.ListServices(producerProjectId, consumerId);
#pragma warning restore CS0612

            // Iterate over all response items, lazily performing RPCs as required
            foreach (ManagedService 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 (ListServicesResponse page in response.AsRawResponses())
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (ManagedService 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 <ManagedService> 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 (ManagedService 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;
        }