Exemplo n.º 1
0
        /// <summary>Snippet for CreateAutoscalingPolicyAsync</summary>
        public async Task CreateAutoscalingPolicyAsync()
        {
            // Snippet: CreateAutoscalingPolicyAsync(string, AutoscalingPolicy, CallSettings)
            // Additional: CreateAutoscalingPolicyAsync(string, AutoscalingPolicy, CancellationToken)
            // Create client
            AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();

            // Initialize request argument(s)
            string            parent = "projects/[PROJECT]/locations/[LOCATION]";
            AutoscalingPolicy policy = new AutoscalingPolicy();
            // Make the request
            AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy);

            // End snippet
        }
Exemplo n.º 2
0
        /// <summary>Snippet for CreateAutoscalingPolicyAsync</summary>
        public async Task CreateAutoscalingPolicyResourceNames2Async()
        {
            // Snippet: CreateAutoscalingPolicyAsync(RegionName, AutoscalingPolicy, CallSettings)
            // Additional: CreateAutoscalingPolicyAsync(RegionName, AutoscalingPolicy, CancellationToken)
            // Create client
            AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();

            // Initialize request argument(s)
            RegionName        parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]");
            AutoscalingPolicy policy = new AutoscalingPolicy();
            // Make the request
            AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy);

            // End snippet
        }
        /// <summary>Snippet for CreateAutoscalingPolicyAsync</summary>
        public async Task CreateAutoscalingPolicyAsync()
        {
            // Snippet: CreateAutoscalingPolicyAsync(string,AutoscalingPolicy,CallSettings)
            // Additional: CreateAutoscalingPolicyAsync(string,AutoscalingPolicy,CancellationToken)
            // Create client
            AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();

            // Initialize request argument(s)
            string            formattedParent = new RegionName("[PROJECT]", "[REGION]").ToString();
            AutoscalingPolicy policy          = new AutoscalingPolicy();
            // Make the request
            AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(formattedParent, policy);

            // End snippet
        }
Exemplo n.º 4
0
        /// <summary>Snippet for CreateAutoscalingPolicyAsync</summary>
        public async Task CreateAutoscalingPolicyRequestObjectAsync()
        {
            // Snippet: CreateAutoscalingPolicyAsync(CreateAutoscalingPolicyRequest, CallSettings)
            // Additional: CreateAutoscalingPolicyAsync(CreateAutoscalingPolicyRequest, CancellationToken)
            // Create client
            AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync();

            // Initialize request argument(s)
            CreateAutoscalingPolicyRequest request = new CreateAutoscalingPolicyRequest
            {
                ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
                Policy = new AutoscalingPolicy(),
            };
            // Make the request
            AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(request);

            // End snippet
        }