Skip to content

Commit 8bee34c

Browse files
feat: Automated regeneration of Compute client (#13046)
Auto-created at 2025-02-28 13:11:43 +0000 using the toys pull request generator.
1 parent a6cc2bc commit 8bee34c

14 files changed

+413
-3
lines changed

clients/compute/lib/google_api/compute/v1/api/instances.ex

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,6 +1827,93 @@ defmodule GoogleApi.Compute.V1.Api.Instances do
18271827
|> Response.decode(opts ++ [struct: %GoogleApi.Compute.V1.Model.Operation{}])
18281828
end
18291829

1830+
@doc """
1831+
Mark the host as faulty and try to restart the instance on a new host.
1832+
1833+
## Parameters
1834+
1835+
* `connection` (*type:* `GoogleApi.Compute.V1.Connection.t`) - Connection to server
1836+
* `project` (*type:* `String.t`) - Project ID for this request.
1837+
* `zone` (*type:* `String.t`) - The name of the zone for this request.
1838+
* `instance` (*type:* `String.t`) - Name of the instance scoping this request.
1839+
* `optional_params` (*type:* `keyword()`) - Optional parameters
1840+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
1841+
* `:access_token` (*type:* `String.t`) - OAuth access token.
1842+
* `:alt` (*type:* `String.t`) - Data format for response.
1843+
* `:callback` (*type:* `String.t`) - JSONP
1844+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
1845+
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
1846+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
1847+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
1848+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1849+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
1850+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
1851+
* `:userIp` (*type:* `String.t`) - Legacy name for parameter that has been superseded by `quotaUser`.
1852+
* `:requestId` (*type:* `String.t`) - An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1853+
* `:body` (*type:* `GoogleApi.Compute.V1.Model.InstancesReportHostAsFaultyRequest.t`) -
1854+
* `opts` (*type:* `keyword()`) - Call options
1855+
1856+
## Returns
1857+
1858+
* `{:ok, %GoogleApi.Compute.V1.Model.Operation{}}` on success
1859+
* `{:error, info}` on failure
1860+
"""
1861+
@spec compute_instances_report_host_as_faulty(
1862+
Tesla.Env.client(),
1863+
String.t(),
1864+
String.t(),
1865+
String.t(),
1866+
keyword(),
1867+
keyword()
1868+
) ::
1869+
{:ok, GoogleApi.Compute.V1.Model.Operation.t()}
1870+
| {:ok, Tesla.Env.t()}
1871+
| {:ok, list()}
1872+
| {:error, any()}
1873+
def compute_instances_report_host_as_faulty(
1874+
connection,
1875+
project,
1876+
zone,
1877+
instance,
1878+
optional_params \\ [],
1879+
opts \\ []
1880+
) do
1881+
optional_params_config = %{
1882+
:"$.xgafv" => :query,
1883+
:access_token => :query,
1884+
:alt => :query,
1885+
:callback => :query,
1886+
:fields => :query,
1887+
:key => :query,
1888+
:oauth_token => :query,
1889+
:prettyPrint => :query,
1890+
:quotaUser => :query,
1891+
:uploadType => :query,
1892+
:upload_protocol => :query,
1893+
:userIp => :query,
1894+
:requestId => :query,
1895+
:body => :body
1896+
}
1897+
1898+
request =
1899+
Request.new()
1900+
|> Request.method(:post)
1901+
|> Request.url(
1902+
"/projects/{project}/zones/{zone}/instances/{instance}/reportHostAsFaulty",
1903+
%{
1904+
"project" => URI.encode(project, &URI.char_unreserved?/1),
1905+
"zone" => URI.encode(zone, &URI.char_unreserved?/1),
1906+
"instance" => URI.encode(instance, &URI.char_unreserved?/1)
1907+
}
1908+
)
1909+
|> Request.add_optional_params(optional_params_config, optional_params)
1910+
|> Request.library_version(@library_version)
1911+
1912+
connection
1913+
|> Connection.execute(request)
1914+
|> Response.decode(opts ++ [struct: %GoogleApi.Compute.V1.Model.Operation{}])
1915+
end
1916+
18301917
@doc """
18311918
Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
18321919

clients/compute/lib/google_api/compute/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.Compute.V1 do
2020
API client metadata for GoogleApi.Compute.V1.
2121
"""
2222

23-
@discovery_revision "20250211"
23+
@discovery_revision "20250224"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Compute.V1.Model.AllocationReservationSharingPolicy do
19+
@moduledoc """
20+
21+
22+
## Attributes
23+
24+
* `serviceShareType` (*type:* `String.t`, *default:* `nil`) - Sharing config for all Google Cloud services.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:serviceShareType => String.t() | nil
31+
}
32+
33+
field(:serviceShareType)
34+
end
35+
36+
defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.AllocationReservationSharingPolicy do
37+
def decode(value, options) do
38+
GoogleApi.Compute.V1.Model.AllocationReservationSharingPolicy.decode(value, options)
39+
end
40+
end
41+
42+
defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.AllocationReservationSharingPolicy do
43+
def encode(value, options) do
44+
GoogleApi.Gax.ModelBase.encode(value, options)
45+
end
46+
end

clients/compute/lib/google_api/compute/v1/model/allocation_resource_status_specific_sku_allocation.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@ defmodule GoogleApi.Compute.V1.Model.AllocationResourceStatusSpecificSKUAllocati
2222
## Attributes
2323
2424
* `sourceInstanceTemplateId` (*type:* `String.t`, *default:* `nil`) - ID of the instance template used to populate reservation properties.
25+
* `utilizations` (*type:* `map()`, *default:* `nil`) - Per service utilization breakdown. The Key is the Google Cloud managed service name.
2526
"""
2627

2728
use GoogleApi.Gax.ModelBase
2829

2930
@type t :: %__MODULE__{
30-
:sourceInstanceTemplateId => String.t() | nil
31+
:sourceInstanceTemplateId => String.t() | nil,
32+
:utilizations => map() | nil
3133
}
3234

3335
field(:sourceInstanceTemplateId)
36+
field(:utilizations, type: :map)
3437
end
3538

3639
defimpl Poison.Decoder,

clients/compute/lib/google_api/compute/v1/model/backend.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ defmodule GoogleApi.Compute.V1.Model.Backend do
2323
2424
* `balancingMode` (*type:* `String.t`, *default:* `nil`) - Specifies how to determine whether the backend of a load balancer can handle additional traffic or is fully loaded. For usage guidelines, see Connection balancing mode. Backends must use compatible balancing modes. For more information, see Supported balancing modes and target capacity settings and Restrictions and guidance for instance groups. Note: Currently, if you use the API to configure incompatible balancing modes, the configuration might be accepted even though it has no impact and is ignored. Specifically, Backend.maxUtilization is ignored when Backend.balancingMode is RATE. In the future, this incompatible combination will be rejected.
2525
* `capacityScaler` (*type:* `number()`, *default:* `nil`) - A multiplier applied to the backend's target capacity of its balancing mode. The default value is 1, which means the group serves up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available capacity. The valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger than 0 and smaller than 0.1. You cannot configure a setting of 0 when there is only one backend attached to the backend service. Not available with backends that don't support using a balancingMode. This includes backends such as global internet NEGs, regional serverless NEGs, and PSC NEGs.
26+
* `customMetrics` (*type:* `list(GoogleApi.Compute.V1.Model.BackendCustomMetric.t)`, *default:* `nil`) - List of custom metrics that are used for CUSTOM_METRICS BalancingMode.
2627
* `description` (*type:* `String.t`, *default:* `nil`) - An optional description of this resource. Provide this property when you create the resource.
2728
* `failover` (*type:* `boolean()`, *default:* `nil`) - This field designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService.
2829
* `group` (*type:* `String.t`, *default:* `nil`) - The fully-qualified URL of an instance group or network endpoint group (NEG) resource. To determine what types of backends a load balancer supports, see the [Backend services overview](https://cloud.google.com/load-balancing/docs/backend-service#backends). You must use the *fully-qualified* URL (starting with https://www.googleapis.com/) to specify the instance group or NEG. Partial URLs are not supported.
@@ -41,6 +42,7 @@ defmodule GoogleApi.Compute.V1.Model.Backend do
4142
@type t :: %__MODULE__{
4243
:balancingMode => String.t() | nil,
4344
:capacityScaler => number() | nil,
45+
:customMetrics => list(GoogleApi.Compute.V1.Model.BackendCustomMetric.t()) | nil,
4446
:description => String.t() | nil,
4547
:failover => boolean() | nil,
4648
:group => String.t() | nil,
@@ -56,6 +58,7 @@ defmodule GoogleApi.Compute.V1.Model.Backend do
5658

5759
field(:balancingMode)
5860
field(:capacityScaler)
61+
field(:customMetrics, as: GoogleApi.Compute.V1.Model.BackendCustomMetric, type: :list)
5962
field(:description)
6063
field(:failover)
6164
field(:group)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Compute.V1.Model.BackendCustomMetric do
19+
@moduledoc """
20+
Custom Metrics are used for CUSTOM_METRICS balancing_mode.
21+
22+
## Attributes
23+
24+
* `dryRun` (*type:* `boolean()`, *default:* `nil`) - If true, the metric data is collected and reported to Cloud Monitoring, but is not used for load balancing.
25+
* `maxUtilization` (*type:* `number()`, *default:* `nil`) - Optional parameter to define a target utilization for the Custom Metrics balancing mode. The valid range is [0.0, 1.0].
26+
* `name` (*type:* `String.t`, *default:* `nil`) - Name of a custom utilization signal. The name must be 1-64 characters long and match the regular expression [a-z]([-_.a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, period, underscore, lowercase letter, or digit, except the last character, which cannot be a dash, period, or underscore. For usage guidelines, see Custom Metrics balancing mode. This field can only be used for a global or regional backend service with the loadBalancingScheme set to EXTERNAL_MANAGED, INTERNAL_MANAGED INTERNAL_SELF_MANAGED.
27+
"""
28+
29+
use GoogleApi.Gax.ModelBase
30+
31+
@type t :: %__MODULE__{
32+
:dryRun => boolean() | nil,
33+
:maxUtilization => number() | nil,
34+
:name => String.t() | nil
35+
}
36+
37+
field(:dryRun)
38+
field(:maxUtilization)
39+
field(:name)
40+
end
41+
42+
defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.BackendCustomMetric do
43+
def decode(value, options) do
44+
GoogleApi.Compute.V1.Model.BackendCustomMetric.decode(value, options)
45+
end
46+
end
47+
48+
defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.BackendCustomMetric do
49+
def encode(value, options) do
50+
GoogleApi.Gax.ModelBase.encode(value, options)
51+
end
52+
end

clients/compute/lib/google_api/compute/v1/model/backend_service.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ defmodule GoogleApi.Compute.V1.Model.BackendService do
6161
* `localityLbPolicy` (*type:* `String.t`, *default:* `nil`) - The load balancing algorithm used within the scope of the locality. The possible values are: - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. - RANDOM: The load balancer selects a random healthy host. - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 This field is applicable to either: - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED, INTERNAL_MANAGED, or EXTERNAL_MANAGED. If sessionAffinity is not configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true.
6262
* `enableCDN` (*type:* `boolean()`, *default:* `nil`) - If true, enables Cloud CDN for the backend service of a global external Application Load Balancer.
6363
* `securityPolicy` (*type:* `String.t`, *default:* `nil`) - [Output Only] The resource URL for the security policy associated with this backend service.
64+
* `customMetrics` (*type:* `list(GoogleApi.Compute.V1.Model.BackendServiceCustomMetric.t)`, *default:* `nil`) - List of custom metrics that are used for the WEIGHTED_ROUND_ROBIN locality_lb_policy.
6465
* `sessionAffinity` (*type:* `String.t`, *default:* `nil`) - Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD are supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. For more details, see: [Session Affinity](https://cloud.google.com/load-balancing/docs/backend-service#session_affinity).
6566
* `serviceBindings` (*type:* `list(String.t)`, *default:* `nil`) - URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty.
6667
* `id` (*type:* `String.t`, *default:* `nil`) - [Output Only] The unique identifier for the resource. This identifier is defined by the server.
@@ -115,6 +116,7 @@ defmodule GoogleApi.Compute.V1.Model.BackendService do
115116
:localityLbPolicy => String.t() | nil,
116117
:enableCDN => boolean() | nil,
117118
:securityPolicy => String.t() | nil,
119+
:customMetrics => list(GoogleApi.Compute.V1.Model.BackendServiceCustomMetric.t()) | nil,
118120
:sessionAffinity => String.t() | nil,
119121
:serviceBindings => list(String.t()) | nil,
120122
:id => String.t() | nil,
@@ -170,6 +172,7 @@ defmodule GoogleApi.Compute.V1.Model.BackendService do
170172
field(:localityLbPolicy)
171173
field(:enableCDN)
172174
field(:securityPolicy)
175+
field(:customMetrics, as: GoogleApi.Compute.V1.Model.BackendServiceCustomMetric, type: :list)
173176
field(:sessionAffinity)
174177
field(:serviceBindings, type: :list)
175178
field(:id)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Compute.V1.Model.BackendServiceCustomMetric do
19+
@moduledoc """
20+
Custom Metrics are used for WEIGHTED_ROUND_ROBIN locality_lb_policy.
21+
22+
## Attributes
23+
24+
* `dryRun` (*type:* `boolean()`, *default:* `nil`) - If true, the metric data is not used for load balancing.
25+
* `name` (*type:* `String.t`, *default:* `nil`) - Name of a custom utilization signal. The name must be 1-64 characters long and match the regular expression [a-z]([-_.a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, period, underscore, lowercase letter, or digit, except the last character, which cannot be a dash, period, or underscore. For usage guidelines, see Custom Metrics balancing mode. This field can only be used for a global or regional backend service with the loadBalancingScheme set to EXTERNAL_MANAGED, INTERNAL_MANAGED INTERNAL_SELF_MANAGED.
26+
"""
27+
28+
use GoogleApi.Gax.ModelBase
29+
30+
@type t :: %__MODULE__{
31+
:dryRun => boolean() | nil,
32+
:name => String.t() | nil
33+
}
34+
35+
field(:dryRun)
36+
field(:name)
37+
end
38+
39+
defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.BackendServiceCustomMetric do
40+
def decode(value, options) do
41+
GoogleApi.Compute.V1.Model.BackendServiceCustomMetric.decode(value, options)
42+
end
43+
end
44+
45+
defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.BackendServiceCustomMetric do
46+
def encode(value, options) do
47+
GoogleApi.Gax.ModelBase.encode(value, options)
48+
end
49+
end

0 commit comments

Comments
 (0)