Autogenerated update (2017-11-16)

Update:
- cloudbuild_v1
- cloudkms_v1
- compute_alpha
- compute_beta
- compute_v1
- container_v1
- container_v1beta1
- dlp_v2beta1
- monitoring_v3
This commit is contained in:
Google APIs committed 2017-11-16 00:35:16 +00:00
1 parent 35a23f126c
commit de77a320ee
25 files changed
+7565 -68

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ module Google
# @see https://cloud.google.com/container-builder/docs/
module CloudbuildV1
VERSION = 'V1'
REVISION = '20171031'
REVISION = '20171115'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -230,12 +230,27 @@ module Google
class BuildOptions
include Google::Apis::Core::Hashable
# Requested disk size for the VM that runs the build. Note that this is *NOT*
# "disk free"; some of the space will be used by the operating system and
# build utilities. Also note that this is the minimum disk size that will be
# allocated for the build -- the build may run with a larger disk than
# requested. At present, the maximum disk size is 1000GB; builds that request
# more than the maximum are rejected with an error.
# Corresponds to the JSON property `diskSizeGb`
# @return [Fixnum]
attr_accessor :disk_size_gb
# LogStreamingOption to define build log streaming behavior to Google Cloud
# Storage.
# Corresponds to the JSON property `logStreamingOption`
# @return [String]
attr_accessor :log_streaming_option
# GCE VM size to run the build on.
# Corresponds to the JSON property `machineType`
# @return [String]
attr_accessor :machine_type
# Requested verifiability options.
# Corresponds to the JSON property `requestedVerifyOption`
# @return [String]
@@ -257,7 +272,9 @@ module Google
# Update properties of this object
def update!(**args)
@disk_size_gb = args[:disk_size_gb] if args.key?(:disk_size_gb)
@log_streaming_option = args[:log_streaming_option] if args.key?(:log_streaming_option)
@machine_type = args[:machine_type] if args.key?(:machine_type)
@requested_verify_option = args[:requested_verify_option] if args.key?(:requested_verify_option)
@source_provenance_hash = args[:source_provenance_hash] if args.key?(:source_provenance_hash)
@substitution_option = args[:substitution_option] if args.key?(:substitution_option)
@@ -209,7 +209,9 @@ module Google
class BuildOptions
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :disk_size_gb, :numeric_string => true, as: 'diskSizeGb'
property :log_streaming_option, as: 'logStreamingOption'
property :machine_type, as: 'machineType'
property :requested_verify_option, as: 'requestedVerifyOption'
collection :source_provenance_hash, as: 'sourceProvenanceHash'
property :substitution_option, as: 'substitutionOption'
+1 -1
View File
@@ -26,7 +26,7 @@ module Google
# @see https://cloud.google.com/kms/
module CloudkmsV1
VERSION = 'V1'
REVISION = '20170829'
REVISION = '20171114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
+2 -1
View File
@@ -206,7 +206,8 @@ module Google
# @return [String]
attr_accessor :create_time
# Labels with user defined metadata.
# Labels with user-defined metadata. For more information, see
# [Labeling CryptoKeys](/kms/docs/labeling-keys).
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
+1 -1
View File
@@ -25,7 +25,7 @@ module Google
# @see https://developers.google.com/compute/docs/reference/latest/
module ComputeAlpha
VERSION = 'Alpha'
REVISION = '20171026'
REVISION = '20171114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
+1 -1
View File
@@ -25,7 +25,7 @@ module Google
# @see https://developers.google.com/compute/docs/reference/latest/
module ComputeBeta
VERSION = 'Beta'
REVISION = '20171010'
REVISION = '20171114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
+1 -1
View File
@@ -25,7 +25,7 @@ module Google
# @see https://developers.google.com/compute/docs/reference/latest/
module ComputeV1
VERSION = 'V1'
REVISION = '20171026'
REVISION = '20171114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
+1 -1
View File
@@ -26,7 +26,7 @@ module Google
# @see https://cloud.google.com/container-engine/
module ContainerV1
VERSION = 'V1'
REVISION = '20171030'
REVISION = '20171111'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -270,9 +270,7 @@ module Google
# @return [Fixnum]
attr_accessor :initial_node_count
# [Output only] The resource URLs of [instance
# groups](/compute/docs/instance-groups/) associated with this
# cluster.
# Deprecated. Use node_pools.instance_group_urls.
# Corresponds to the JSON property `instanceGroupUrls`
# @return [Array<String>]
attr_accessor :instance_group_urls
@@ -1334,9 +1332,9 @@ module Google
# @return [Fixnum]
attr_accessor :initial_node_count
# [Output only] The resource URLs of [instance
# groups](/compute/docs/instance-groups/) associated with this
# node pool.
# [Output only] The resource URLs of the [managed instance
# groups](/compute/docs/instance-groups/creating-groups-of-managed-instances)
# associated with this node pool.
# Corresponds to the JSON property `instanceGroupUrls`
# @return [Array<String>]
attr_accessor :instance_group_urls
+1 -1
View File
@@ -26,7 +26,7 @@ module Google
# @see https://cloud.google.com/container-engine/
module ContainerV1beta1
VERSION = 'V1beta1'
REVISION = '20171030'
REVISION = '20171111'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -300,9 +300,7 @@ module Google
# @return [Fixnum]
attr_accessor :initial_node_count
# [Output only] The resource URLs of [instance
# groups](/compute/docs/instance-groups/) associated with this
# cluster.
# Deprecated. Use node_pools.instance_group_urls.
# Corresponds to the JSON property `instanceGroupUrls`
# @return [Array<String>]
attr_accessor :instance_group_urls
@@ -1426,9 +1424,9 @@ module Google
# @return [Fixnum]
attr_accessor :initial_node_count
# [Output only] The resource URLs of [instance
# groups](/compute/docs/instance-groups/) associated with this
# node pool.
# [Output only] The resource URLs of the [managed instance
# groups](/compute/docs/instance-groups/creating-groups-of-managed-instances)
# associated with this node pool.
# Corresponds to the JSON property `instanceGroupUrls`
# @return [Array<String>]
attr_accessor :instance_group_urls
+1 -1
View File
@@ -27,7 +27,7 @@ module Google
# @see https://cloud.google.com/dlp/docs/
module DlpV2beta1
VERSION = 'V2beta1'
REVISION = '20171024'
REVISION = '20171114'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
+1 -1
View File
@@ -27,7 +27,7 @@ module Google
# @see https://cloud.google.com/monitoring/api/
module MonitoringV3
VERSION = 'V3'
REVISION = '20171105'
REVISION = '20171113'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
+55 -46
View File
@@ -812,6 +812,50 @@ module Google
end
end
# Nimbus InternalCheckers.
class InternalChecker
include Google::Apis::Core::Hashable
# The checker ID.
# Corresponds to the JSON property `checkerId`
# @return [String]
attr_accessor :checker_id
# The checker's human-readable name.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# The GCP zone the uptime check should egress from. Only respected for internal
# uptime checks, where internal_network is specified.
# Corresponds to the JSON property `gcpZone`
# @return [String]
attr_accessor :gcp_zone
# The internal network to perform this uptime check on.
# Corresponds to the JSON property `network`
# @return [String]
attr_accessor :network
# The GCP project ID. Not necessarily the same as the project_id for the config.
# Corresponds to the JSON property `projectId`
# @return [String]
attr_accessor :project_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@checker_id = args[:checker_id] if args.key?(:checker_id)
@display_name = args[:display_name] if args.key?(:display_name)
@gcp_zone = args[:gcp_zone] if args.key?(:gcp_zone)
@network = args[:network] if args.key?(:network)
@project_id = args[:project_id] if args.key?(:project_id)
end
end
# A description of a label.
class LabelDescriptor
include Google::Apis::Core::Hashable
@@ -1157,52 +1201,11 @@ module Google
# @return [String]
attr_accessor :type
# The unit in which the metric value is reported. It is only applicable if the
# value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a subset
# of The Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html)
# standard:Basic units (UNIT)
# bit bit
# By byte
# s second
# min minute
# h hour
# d dayPrefixes (PREFIX)
# k kilo (10**3)
# M mega (10**6)
# G giga (10**9)
# T tera (10**12)
# P peta (10**15)
# E exa (10**18)
# Z zetta (10**21)
# Y yotta (10**24)
# m milli (10**-3)
# u micro (10**-6)
# n nano (10**-9)
# p pico (10**-12)
# f femto (10**-15)
# a atto (10**-18)
# z zepto (10**-21)
# y yocto (10**-24)
# Ki kibi (2**10)
# Mi mebi (2**20)
# Gi gibi (2**30)
# Ti tebi (2**40)GrammarThe grammar includes the dimensionless unit 1, such as 1/
# s.The grammar also includes these connectors:
# / division (as an infix operator, e.g. 1/s).
# . multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit is
# as follows:
# Expression = Component ` "." Component ` ` "/" Component ` ;
# Component = [ PREFIX ] UNIT [ Annotation ]
# | Annotation
# | "1"
# ;
# Annotation = "`" NAME "`" ;
# Notes:
# Annotation is just a comment if it follows a UNIT and is equivalent to 1 if
# it is used alone. For examples, `requests`/s == 1/s, By`transmitted`/s == By/
# s.
# NAME is a sequence of non-blank printable ASCII characters not containing '`'
# or '`'.
# Optional. The unit in which the metric value is reported. For example, kBy/s
# means kilobytes/sec, and 1 is the dimensionless unit. The supported units are
# a subset of The Unified Code for Units of Measure standard (http://
# unitsofmeasure.org/ucum.html).<br><br> This field is part of the metric's
# documentation, but it is ignored by Stackdriver.
# Corresponds to the JSON property `unit`
# @return [String]
attr_accessor :unit
@@ -1783,6 +1786,11 @@ module Google
# @return [Google::Apis::MonitoringV3::HttpCheck]
attr_accessor :http_check
# The internal checkers that this check will egress from.
# Corresponds to the JSON property `internalCheckers`
# @return [Array<Google::Apis::MonitoringV3::InternalChecker>]
attr_accessor :internal_checkers
# An object representing a resource that can be used for monitoring, logging,
# billing, or other purposes. Examples include virtual machine instances,
# databases, and storage devices such as disks. The type field identifies a
@@ -1847,6 +1855,7 @@ module Google
@content_matchers = args[:content_matchers] if args.key?(:content_matchers)
@display_name = args[:display_name] if args.key?(:display_name)
@http_check = args[:http_check] if args.key?(:http_check)
@internal_checkers = args[:internal_checkers] if args.key?(:internal_checkers)
@monitored_resource = args[:monitored_resource] if args.key?(:monitored_resource)
@name = args[:name] if args.key?(:name)
@period = args[:period] if args.key?(:period)
@@ -124,6 +124,12 @@ module Google
include Google::Apis::Core::JsonObjectSupport
end
class InternalChecker
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class LabelDescriptor
class Representation < Google::Apis::Core::JsonRepresentation; end
@@ -457,6 +463,17 @@ module Google
end
end
class InternalChecker
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :checker_id, as: 'checkerId'
property :display_name, as: 'displayName'
property :gcp_zone, as: 'gcpZone'
property :network, as: 'network'
property :project_id, as: 'projectId'
end
end
class LabelDescriptor
# @private
class Representation < Google::Apis::Core::JsonRepresentation
@@ -696,6 +713,8 @@ module Google
property :display_name, as: 'displayName'
property :http_check, as: 'httpCheck', class: Google::Apis::MonitoringV3::HttpCheck, decorator: Google::Apis::MonitoringV3::HttpCheck::Representation
collection :internal_checkers, as: 'internalCheckers', class: Google::Apis::MonitoringV3::InternalChecker, decorator: Google::Apis::MonitoringV3::InternalChecker::Representation
property :monitored_resource, as: 'monitoredResource', class: Google::Apis::MonitoringV3::MonitoredResource, decorator: Google::Apis::MonitoringV3::MonitoredResource::Representation
property :name, as: 'name'
@@ -0,0 +1,38 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'google/apis/serviceconsumermanagement_v1/service.rb'
require 'google/apis/serviceconsumermanagement_v1/classes.rb'
require 'google/apis/serviceconsumermanagement_v1/representations.rb'
module Google
module Apis
# Service Consumer Management API
#
# Provides management methods for configuring service producer resources on
# Google Cloud.
#
# @see https://cloud.google.com/service-consumer-management/docs/overview
module ServiceconsumermanagementV1
VERSION = 'V1'
REVISION = '20171113'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
# Manage your Google API service configuration
AUTH_SERVICE_MANAGEMENT = 'https://www.googleapis.com/auth/service.management'
end
end
end
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,467 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module ServiceconsumermanagementV1
# Service Consumer Management API
#
# Provides management methods for configuring service producer resources on
# Google Cloud.
#
# @example
# require 'google/apis/serviceconsumermanagement_v1'
#
# Serviceconsumermanagement = Google::Apis::ServiceconsumermanagementV1 # Alias the module
# service = Serviceconsumermanagement::ServiceConsumerManagementService.new
#
# @see https://cloud.google.com/service-consumer-management/docs/overview
class ServiceConsumerManagementService < Google::Apis::Core::BaseService
# @return [String]
# 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.
attr_accessor :key
# @return [String]
# 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.
attr_accessor :quota_user
def initialize
super('https://serviceconsumermanagement.googleapis.com/', '')
@batch_path = 'batch'
end
# Starts asynchronous cancellation on a long-running operation. The server
# makes a best effort to cancel the operation, but success is not
# guaranteed. If the server doesn't support this method, it returns
# `google.rpc.Code.UNIMPLEMENTED`. Clients can use
# Operations.GetOperation or
# other methods to check whether the cancellation succeeded or whether the
# operation completed despite cancellation. On successful cancellation,
# the operation is not deleted; instead, it becomes an operation with
# an Operation.error value with a google.rpc.Status.code of 1,
# corresponding to `Code.CANCELLED`.
# @param [String] name
# The name of the operation resource to be cancelled.
# @param [Google::Apis::ServiceconsumermanagementV1::CancelOperationRequest] cancel_operation_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::Empty]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+name}:cancel', options)
command.request_representation = Google::Apis::ServiceconsumermanagementV1::CancelOperationRequest::Representation
command.request_object = cancel_operation_request_object
command.response_representation = Google::Apis::ServiceconsumermanagementV1::Empty::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes a long-running operation. This method indicates that the client is
# no longer interested in the operation result. It does not cancel the
# operation. If the server doesn't support this method, it returns
# `google.rpc.Code.UNIMPLEMENTED`.
# @param [String] name
# The name of the operation resource to be deleted.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::Empty]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v1/{+name}', options)
command.response_representation = Google::Apis::ServiceconsumermanagementV1::Empty::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the latest state of a long-running operation. Clients can use this
# method to poll the operation result at intervals as recommended by the API
# service.
# @param [String] name
# The name of the operation resource.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+name}', options)
command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists operations that match the specified filter in the request. If the
# server doesn't support this method, it returns `UNIMPLEMENTED`.
# NOTE: the `name` binding allows API services to override the binding
# to use different resource name schemes, such as `users/*/operations`. To
# override the binding, API services can add a binding such as
# `"/v1/`name=users/*`/operations"` to their service configuration.
# For backwards compatibility, the default name includes the operations
# collection id, however overriding users must ensure the name binding
# is the parent resource, without the operations collection id.
# @param [String] name
# The name of the operation's parent resource.
# @param [String] filter
# The standard list filter.
# @param [Fixnum] page_size
# The standard list page size.
# @param [String] page_token
# The standard list page token.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::ListOperationsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::ListOperationsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+name}', options)
command.response_representation = Google::Apis::ServiceconsumermanagementV1::ListOperationsResponse::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::ListOperationsResponse
command.params['name'] = name unless name.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Search tenancy units for a service.
# @param [String] parent
# Service for which search is performed.
# services/`service`
# `service` the name of a service, for example 'service.googleapis.com'.
# @param [Fixnum] page_size
# The maximum number of results returned by this request. Currently, the
# default maximum is set to 1000. If page_size is not provided or provided a
# number larger than 1000, it will be automatically set to 1000.
# Optional.
# @param [String] page_token
# The continuation token, which is used to page through large result sets.
# To get the next page of results, set this parameter to the value of
# `nextPageToken` from the previous response.
# Optional.
# @param [String] query
# Set a query ``expression`` for querying tenancy units. Your ``expression``
# must be in the format: `field_name=literal_string`. The `field_name` is the
# name of the field you want to compare. Supported fields are
# `tenant_resources.tag` and`tenant_resources.resource`.
# For example, to search tenancy units that contain at least one tenant
# resource with given tag 'xyz', use query `tenant_resources.tag=xyz`.
# To search tenancy units that contain at least one tenant resource with
# given resource name 'projects/123456', use query
# `tenant_resources.resource=projects/123456`.
# Multiple expressions can be joined with `AND`s. Tenancy units must match
# all expressions to be included in the result set. For example,
# `tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456`
# Optional.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::SearchTenancyUnitsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::SearchTenancyUnitsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def search_services(parent, page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+parent}:search', options)
command.response_representation = Google::Apis::ServiceconsumermanagementV1::SearchTenancyUnitsResponse::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::SearchTenancyUnitsResponse
command.params['parent'] = parent unless parent.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['query'] = query unless query.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Add a new tenant project to the tenancy unit.
# If there are previously failed AddTenantProject calls, you might need to
# call RemoveTenantProject first to clean them before you can make another
# AddTenantProject with the same tag.
# Operation<response: Empty>.
# @param [String] parent
# Name of the tenancy unit.
# @param [Google::Apis::ServiceconsumermanagementV1::AddTenantProjectRequest] add_tenant_project_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def add_service_tenancy_unit_project(parent, add_tenant_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+parent}:addProject', options)
command.request_representation = Google::Apis::ServiceconsumermanagementV1::AddTenantProjectRequest::Representation
command.request_object = add_tenant_project_request_object
command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Creates a tenancy unit with no tenant resources.
# @param [String] parent
# services/`service`/`collection id`/`resource id`
# `collection id` is the cloud resource collection type representing the
# service consumer, for example 'projects', or 'organizations'.
# `resource id` is the consumer numeric id, such as project number: '123456'.
# `service` the name of a service, for example 'service.googleapis.com'.
# Enabled service binding using the new tenancy unit.
# @param [Google::Apis::ServiceconsumermanagementV1::CreateTenancyUnitRequest] create_tenancy_unit_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::TenancyUnit] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::TenancyUnit]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def create_tenancy_unit(parent, create_tenancy_unit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+parent}/tenancyUnits', options)
command.request_representation = Google::Apis::ServiceconsumermanagementV1::CreateTenancyUnitRequest::Representation
command.request_object = create_tenancy_unit_request_object
command.response_representation = Google::Apis::ServiceconsumermanagementV1::TenancyUnit::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::TenancyUnit
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Delete tenancy unit. Before the tenancy unit is deleted, there should be
# no tenant resource in it.
# Operation<response: Empty>.
# @param [String] name
# Name of the tenancy unit to be deleted.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_service_tenancy_unit(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v1/{+name}', options)
command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Find tenancy unit for a service and consumer.
# This method should not be used in producers' runtime path, e.g. finding
# the tenant project number when creating VMs. Producers should persist
# the tenant project information after the project is created.
# @param [String] parent
# Service and consumer. Required.
# services/`service`/`collection id`/`resource id`
# `collection id` is the cloud resource collection type representing the
# service consumer, for example 'projects', or 'organizations'.
# `resource id` is the consumer numeric id, such as project number: '123456'.
# `service` the name of a service, for example 'service.googleapis.com'.
# @param [String] filter
# Filter expression over tenancy resources field. Optional.
# @param [Fixnum] page_size
# The maximum number of results returned by this request.
# @param [String] page_token
# The continuation token, which is used to page through large result sets.
# To get the next page of results, set this parameter to the value of
# `nextPageToken` from the previous response.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::ListTenancyUnitsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::ListTenancyUnitsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_service_tenancy_units(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1/{+parent}/tenancyUnits', options)
command.response_representation = Google::Apis::ServiceconsumermanagementV1::ListTenancyUnitsResponse::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::ListTenancyUnitsResponse
command.params['parent'] = parent unless parent.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Removes specified project resource identified by tenant resource tag.
# It will remove project lien with 'TenantManager' origin if that was added.
# It will then attempt to delete the project.
# If that operation fails, this method fails.
# Operation<response: Empty>.
# @param [String] name
# Name of the tenancy unit.
# Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'.
# @param [Google::Apis::ServiceconsumermanagementV1::RemoveTenantProjectRequest] remove_tenant_project_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::ServiceconsumermanagementV1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::ServiceconsumermanagementV1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def remove_service_tenancy_unit_project(name, remove_tenant_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1/{+name}:removeProject', options)
command.request_representation = Google::Apis::ServiceconsumermanagementV1::RemoveTenantProjectRequest::Representation
command.request_object = remove_tenant_project_request_object
command.response_representation = Google::Apis::ServiceconsumermanagementV1::Operation::Representation
command.response_class = Google::Apis::ServiceconsumermanagementV1::Operation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
protected
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
end
end
end
end
end
+34
View File
@@ -0,0 +1,34 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'google/apis/tpu_v1alpha1/service.rb'
require 'google/apis/tpu_v1alpha1/classes.rb'
require 'google/apis/tpu_v1alpha1/representations.rb'
module Google
module Apis
# Cloud TPU API
#
# TPU API provides customers with access to Google TPU technology.
#
# @see https://cloud.google.com/tpu/
module TpuV1alpha1
VERSION = 'V1alpha1'
REVISION = '20171108'
# View and manage your data across Google Cloud Platform services
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
end
end
end
@@ -0,0 +1,530 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module TpuV1alpha1
# A generic empty message that you can re-use to avoid defining duplicated
# empty messages in your APIs. A typical example is to use it as the request
# or the response type of an API method. For instance:
# service Foo `
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
# `
# The JSON representation for `Empty` is empty JSON object ````.
class Empty
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# The response message for Locations.ListLocations.
class ListLocationsResponse
include Google::Apis::Core::Hashable
# A list of locations that matches the specified filter in the request.
# Corresponds to the JSON property `locations`
# @return [Array<Google::Apis::TpuV1alpha1::Location>]
attr_accessor :locations
# The standard List next-page token.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@locations = args[:locations] if args.key?(:locations)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
end
end
# Response for ListNodes.
class ListNodesResponse
include Google::Apis::Core::Hashable
# The next page token or empty if none.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# The listed nodes.
# Corresponds to the JSON property `nodes`
# @return [Array<Google::Apis::TpuV1alpha1::Node>]
attr_accessor :nodes
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@nodes = args[:nodes] if args.key?(:nodes)
end
end
# The response message for Operations.ListOperations.
class ListOperationsResponse
include Google::Apis::Core::Hashable
# The standard List next-page token.
# Corresponds to the JSON property `nextPageToken`
# @return [String]
attr_accessor :next_page_token
# A list of operations that matches the specified filter in the request.
# Corresponds to the JSON property `operations`
# @return [Array<Google::Apis::TpuV1alpha1::Operation>]
attr_accessor :operations
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
@operations = args[:operations] if args.key?(:operations)
end
end
# A resource that represents Google Cloud Platform location.
class Location
include Google::Apis::Core::Hashable
# Cross-service attributes for the location. For example
# `"cloud.googleapis.com/region": "us-east1"`
# Corresponds to the JSON property `labels`
# @return [Hash<String,String>]
attr_accessor :labels
# The canonical id for this location. For example: `"us-east1"`.
# Corresponds to the JSON property `locationId`
# @return [String]
attr_accessor :location_id
# Service-specific metadata. For example the available capacity at the given
# location.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
# Resource name for the location, which may vary between implementations.
# For example: `"projects/example-project/locations/us-east1"`
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@labels = args[:labels] if args.key?(:labels)
@location_id = args[:location_id] if args.key?(:location_id)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
end
end
# A network endpoint over which a TPU worker can be reached.
class NetworkEndpoint
include Google::Apis::Core::Hashable
# The IP address of this network endpoint.
# Corresponds to the JSON property `ipAddress`
# @return [String]
attr_accessor :ip_address
# The port of this network endpoint.
# Corresponds to the JSON property `port`
# @return [Fixnum]
attr_accessor :port
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@ip_address = args[:ip_address] if args.key?(:ip_address)
@port = args[:port] if args.key?(:port)
end
end
# A TPU instance.
class Node
include Google::Apis::Core::Hashable
# The type of hardware accelerators associated with this node.
# Required.
# Corresponds to the JSON property `acceleratorType`
# @return [String]
attr_accessor :accelerator_type
# The CIDR block that the TPU node will use when selecting //an IP address.
# This CIDR block must be a /29 block; the GCE networks API forbids a smaller
# block, and using a larger block would be wasteful (a node can only consume
# one IP address). Errors will occur if the CIDR block has already been used
# for a currently existing TPU node, the CIDR block conflicts with any
# subnetworks in the user's provided network, or the provided network is
# peered with another network that is using that CIDR block.
# Required.
# Corresponds to the JSON property `cidrBlock`
# @return [String]
attr_accessor :cidr_block
# The time when the node was created.
# Output only.
# Corresponds to the JSON property `createTime`
# @return [String]
attr_accessor :create_time
# The user-supplied description of the TPU. Maximum of 512 characters.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# If this field is populated, it contains a description of why the TPU Node
# is unhealthy.
# Output only.
# Corresponds to the JSON property `healthDescription`
# @return [String]
attr_accessor :health_description
# Output only.
# DEPRECATED! Use network_endpoints instead.
# The network address for the TPU Node as visible to GCE instances.
# Corresponds to the JSON property `ipAddress`
# @return [String]
attr_accessor :ip_address
# The immutable name of the TPU
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The name of a network they wish to peer the TPU node to. It must be a
# preexisting GCE network inside of the project on which this API has been
# activated. If none is provided, "default" will be used.
# Corresponds to the JSON property `network`
# @return [String]
attr_accessor :network
# Output only. The network endpoints where TPU workers can be accessed and sent
# work.
# It is recommended that Tensorflow clients of the node reach out to the 0th
# entry in this map first.
# Corresponds to the JSON property `networkEndpoints`
# @return [Array<Google::Apis::TpuV1alpha1::NetworkEndpoint>]
attr_accessor :network_endpoints
# Output only.
# DEPRECATED! Use network_endpoints instead.
# The network port for the TPU Node as visible to GCE instances.
# Corresponds to the JSON property `port`
# @return [String]
attr_accessor :port
# The service account used to run the tensor flow services within the node.
# To share resources, including Google Cloud Storage data, with the
# Tensorflow job running in the Node, this account must have permissions to
# that data.
# Output only.
# Corresponds to the JSON property `serviceAccount`
# @return [String]
attr_accessor :service_account
# The current state for the TPU Node.
# Output only.
# Corresponds to the JSON property `state`
# @return [String]
attr_accessor :state
# The version of Tensorflow running in the Node.
# Required.
# Corresponds to the JSON property `tensorflowVersion`
# @return [String]
attr_accessor :tensorflow_version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@accelerator_type = args[:accelerator_type] if args.key?(:accelerator_type)
@cidr_block = args[:cidr_block] if args.key?(:cidr_block)
@create_time = args[:create_time] if args.key?(:create_time)
@description = args[:description] if args.key?(:description)
@health_description = args[:health_description] if args.key?(:health_description)
@ip_address = args[:ip_address] if args.key?(:ip_address)
@name = args[:name] if args.key?(:name)
@network = args[:network] if args.key?(:network)
@network_endpoints = args[:network_endpoints] if args.key?(:network_endpoints)
@port = args[:port] if args.key?(:port)
@service_account = args[:service_account] if args.key?(:service_account)
@state = args[:state] if args.key?(:state)
@tensorflow_version = args[:tensorflow_version] if args.key?(:tensorflow_version)
end
end
# This resource represents a long-running operation that is the result of a
# network API call.
class Operation
include Google::Apis::Core::Hashable
# If the value is `false`, it means the operation is still in progress.
# If `true`, the operation is completed, and either `error` or `response` is
# available.
# Corresponds to the JSON property `done`
# @return [Boolean]
attr_accessor :done
alias_method :done?, :done
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by
# [gRPC](https://github.com/grpc). The error model is designed to be:
# - Simple to use and understand for most users
# - Flexible enough to meet unexpected needs
# # Overview
# The `Status` message contains three pieces of data: error code, error message,
# and error details. The error code should be an enum value of
# google.rpc.Code, but it may accept additional error codes if needed. The
# error message should be a developer-facing English message that helps
# developers *understand* and *resolve* the error. If a localized user-facing
# error message is needed, put the localized message in the error details or
# localize it in the client. The optional error details may contain arbitrary
# information about the error. There is a predefined set of error detail types
# in the package `google.rpc` that can be used for common error conditions.
# # Language mapping
# The `Status` message is the logical representation of the error model, but it
# is not necessarily the actual wire format. When the `Status` message is
# exposed in different client libraries and different wire protocols, it can be
# mapped differently. For example, it will likely be mapped to some exceptions
# in Java, but more likely mapped to some error codes in C.
# # Other uses
# The error model and the `Status` message can be used in a variety of
# environments, either with or without APIs, to provide a
# consistent developer experience across different environments.
# Example uses of this error model include:
# - Partial errors. If a service needs to return partial errors to the client,
# it may embed the `Status` in the normal response to indicate the partial
# errors.
# - Workflow errors. A typical workflow has multiple steps. Each step may
# have a `Status` message for error reporting.
# - Batch operations. If a client uses batch request and batch response, the
# `Status` message should be used directly inside batch response, one for
# each error sub-response.
# - Asynchronous operations. If an API call embeds asynchronous operation
# results in its response, the status of those operations should be
# represented directly using the `Status` message.
# - Logging. If some API errors are stored in logs, the message `Status` could
# be used directly after any stripping needed for security/privacy reasons.
# Corresponds to the JSON property `error`
# @return [Google::Apis::TpuV1alpha1::Status]
attr_accessor :error
# Service-specific metadata associated with the operation. It typically
# contains progress information and common metadata such as create time.
# Some services might not provide such metadata. Any method that returns a
# long-running operation should document the metadata type, if any.
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Object>]
attr_accessor :metadata
# The server-assigned name, which is only unique within the same service that
# originally returns it. If you use the default HTTP mapping, the
# `name` should have the format of `operations/some/unique/name`.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The normal response of the operation in case of success. If the original
# method returns no data on success, such as `Delete`, the response is
# `google.protobuf.Empty`. If the original method is standard
# `Get`/`Create`/`Update`, the response should be the resource. For other
# methods, the response should have the type `XxxResponse`, where `Xxx`
# is the original method name. For example, if the original method name
# is `TakeSnapshot()`, the inferred response type is
# `TakeSnapshotResponse`.
# Corresponds to the JSON property `response`
# @return [Hash<String,Object>]
attr_accessor :response
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@done = args[:done] if args.key?(:done)
@error = args[:error] if args.key?(:error)
@metadata = args[:metadata] if args.key?(:metadata)
@name = args[:name] if args.key?(:name)
@response = args[:response] if args.key?(:response)
end
end
# Represents the metadata of the long-running operation.
class OperationMetadata
include Google::Apis::Core::Hashable
# [Output only] API version used to start the operation.
# Corresponds to the JSON property `apiVersion`
# @return [String]
attr_accessor :api_version
# [Output only] Identifies whether the user has requested cancellation
# of the operation. Operations that have successfully been cancelled
# have Operation.error value with a google.rpc.Status.code of 1,
# corresponding to `Code.CANCELLED`.
# Corresponds to the JSON property `cancelRequested`
# @return [Boolean]
attr_accessor :cancel_requested
alias_method :cancel_requested?, :cancel_requested
# [Output only] The time the operation was created.
# Corresponds to the JSON property `createTime`
# @return [String]
attr_accessor :create_time
# [Output only] The time the operation finished running.
# Corresponds to the JSON property `endTime`
# @return [String]
attr_accessor :end_time
# [Output only] Human-readable status of the operation, if any.
# Corresponds to the JSON property `statusDetail`
# @return [String]
attr_accessor :status_detail
# [Output only] Server-defined resource path for the target of the operation.
# Corresponds to the JSON property `target`
# @return [String]
attr_accessor :target
# [Output only] Name of the verb executed by the operation.
# Corresponds to the JSON property `verb`
# @return [String]
attr_accessor :verb
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@api_version = args[:api_version] if args.key?(:api_version)
@cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)
@create_time = args[:create_time] if args.key?(:create_time)
@end_time = args[:end_time] if args.key?(:end_time)
@status_detail = args[:status_detail] if args.key?(:status_detail)
@target = args[:target] if args.key?(:target)
@verb = args[:verb] if args.key?(:verb)
end
end
# The `Status` type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by
# [gRPC](https://github.com/grpc). The error model is designed to be:
# - Simple to use and understand for most users
# - Flexible enough to meet unexpected needs
# # Overview
# The `Status` message contains three pieces of data: error code, error message,
# and error details. The error code should be an enum value of
# google.rpc.Code, but it may accept additional error codes if needed. The
# error message should be a developer-facing English message that helps
# developers *understand* and *resolve* the error. If a localized user-facing
# error message is needed, put the localized message in the error details or
# localize it in the client. The optional error details may contain arbitrary
# information about the error. There is a predefined set of error detail types
# in the package `google.rpc` that can be used for common error conditions.
# # Language mapping
# The `Status` message is the logical representation of the error model, but it
# is not necessarily the actual wire format. When the `Status` message is
# exposed in different client libraries and different wire protocols, it can be
# mapped differently. For example, it will likely be mapped to some exceptions
# in Java, but more likely mapped to some error codes in C.
# # Other uses
# The error model and the `Status` message can be used in a variety of
# environments, either with or without APIs, to provide a
# consistent developer experience across different environments.
# Example uses of this error model include:
# - Partial errors. If a service needs to return partial errors to the client,
# it may embed the `Status` in the normal response to indicate the partial
# errors.
# - Workflow errors. A typical workflow has multiple steps. Each step may
# have a `Status` message for error reporting.
# - Batch operations. If a client uses batch request and batch response, the
# `Status` message should be used directly inside batch response, one for
# each error sub-response.
# - Asynchronous operations. If an API call embeds asynchronous operation
# results in its response, the status of those operations should be
# represented directly using the `Status` message.
# - Logging. If some API errors are stored in logs, the message `Status` could
# be used directly after any stripping needed for security/privacy reasons.
class Status
include Google::Apis::Core::Hashable
# The status code, which should be an enum value of google.rpc.Code.
# Corresponds to the JSON property `code`
# @return [Fixnum]
attr_accessor :code
# A list of messages that carry the error details. There is a common set of
# message types for APIs to use.
# Corresponds to the JSON property `details`
# @return [Array<Hash<String,Object>>]
attr_accessor :details
# A developer-facing error message, which should be in English. Any
# user-facing error message should be localized and sent in the
# google.rpc.Status.details field, or localized by the client.
# Corresponds to the JSON property `message`
# @return [String]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@code = args[:code] if args.key?(:code)
@details = args[:details] if args.key?(:details)
@message = args[:message] if args.key?(:message)
end
end
end
end
end
@@ -0,0 +1,191 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module TpuV1alpha1
class Empty
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListLocationsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListNodesResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ListOperationsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Location
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class NetworkEndpoint
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Node
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Operation
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class OperationMetadata
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Status
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class Empty
# @private
class Representation < Google::Apis::Core::JsonRepresentation
end
end
class ListLocationsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :locations, as: 'locations', class: Google::Apis::TpuV1alpha1::Location, decorator: Google::Apis::TpuV1alpha1::Location::Representation
property :next_page_token, as: 'nextPageToken'
end
end
class ListNodesResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :nodes, as: 'nodes', class: Google::Apis::TpuV1alpha1::Node, decorator: Google::Apis::TpuV1alpha1::Node::Representation
end
end
class ListOperationsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :next_page_token, as: 'nextPageToken'
collection :operations, as: 'operations', class: Google::Apis::TpuV1alpha1::Operation, decorator: Google::Apis::TpuV1alpha1::Operation::Representation
end
end
class Location
# @private
class Representation < Google::Apis::Core::JsonRepresentation
hash :labels, as: 'labels'
property :location_id, as: 'locationId'
hash :metadata, as: 'metadata'
property :name, as: 'name'
end
end
class NetworkEndpoint
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :ip_address, as: 'ipAddress'
property :port, as: 'port'
end
end
class Node
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :accelerator_type, as: 'acceleratorType'
property :cidr_block, as: 'cidrBlock'
property :create_time, as: 'createTime'
property :description, as: 'description'
property :health_description, as: 'healthDescription'
property :ip_address, as: 'ipAddress'
property :name, as: 'name'
property :network, as: 'network'
collection :network_endpoints, as: 'networkEndpoints', class: Google::Apis::TpuV1alpha1::NetworkEndpoint, decorator: Google::Apis::TpuV1alpha1::NetworkEndpoint::Representation
property :port, as: 'port'
property :service_account, as: 'serviceAccount'
property :state, as: 'state'
property :tensorflow_version, as: 'tensorflowVersion'
end
end
class Operation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :done, as: 'done'
property :error, as: 'error', class: Google::Apis::TpuV1alpha1::Status, decorator: Google::Apis::TpuV1alpha1::Status::Representation
hash :metadata, as: 'metadata'
property :name, as: 'name'
hash :response, as: 'response'
end
end
class OperationMetadata
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :api_version, as: 'apiVersion'
property :cancel_requested, as: 'cancelRequested'
property :create_time, as: 'createTime'
property :end_time, as: 'endTime'
property :status_detail, as: 'statusDetail'
property :target, as: 'target'
property :verb, as: 'verb'
end
end
class Status
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :code, as: 'code'
collection :details, as: 'details'
property :message, as: 'message'
end
end
end
end
end
@@ -0,0 +1,474 @@
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module TpuV1alpha1
# Cloud TPU API
#
# TPU API provides customers with access to Google TPU technology.
#
# @example
# require 'google/apis/tpu_v1alpha1'
#
# Tpu = Google::Apis::TpuV1alpha1 # Alias the module
# service = Tpu::TPUService.new
#
# @see https://cloud.google.com/tpu/
class TPUService < Google::Apis::Core::BaseService
# @return [String]
# 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.
attr_accessor :key
# @return [String]
# 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.
attr_accessor :quota_user
def initialize
super('https://tpu.googleapis.com/', '')
@batch_path = 'batch'
end
# Get information about a location.
# @param [String] name
# Resource name for the location.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Location] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Location]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_location(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1alpha1/{+name}', options)
command.response_representation = Google::Apis::TpuV1alpha1::Location::Representation
command.response_class = Google::Apis::TpuV1alpha1::Location
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists information about the supported locations for this service.
# @param [String] name
# The resource that owns the locations collection, if applicable.
# @param [String] filter
# The standard list filter.
# @param [Fixnum] page_size
# The standard list page size.
# @param [String] page_token
# The standard list page token.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::ListLocationsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::ListLocationsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1alpha1/{+name}/locations', options)
command.response_representation = Google::Apis::TpuV1alpha1::ListLocationsResponse::Representation
command.response_class = Google::Apis::TpuV1alpha1::ListLocationsResponse
command.params['name'] = name unless name.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Creates a node.
# @param [String] parent
# The parent resource name.
# @param [Google::Apis::TpuV1alpha1::Node] node_object
# @param [String] node_id
# The unqualified resource name.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def create_project_location_node(parent, node_object = nil, node_id: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1alpha1/{+parent}/nodes', options)
command.request_representation = Google::Apis::TpuV1alpha1::Node::Representation
command.request_object = node_object
command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
command.response_class = Google::Apis::TpuV1alpha1::Operation
command.params['parent'] = parent unless parent.nil?
command.query['nodeId'] = node_id unless node_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes a node.
# @param [String] name
# The resource name.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_project_location_node(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v1alpha1/{+name}', options)
command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
command.response_class = Google::Apis::TpuV1alpha1::Operation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the details of a node.
# @param [String] name
# The resource name.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Node] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Node]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_location_node(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1alpha1/{+name}', options)
command.response_representation = Google::Apis::TpuV1alpha1::Node::Representation
command.response_class = Google::Apis::TpuV1alpha1::Node
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists nodes.
# @param [String] parent
# The parent resource name.
# @param [Fixnum] page_size
# The maximum number of items to return.
# @param [String] page_token
# The next_page_token value returned from a previous List request, if any.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::ListNodesResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::ListNodesResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_project_location_nodes(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1alpha1/{+parent}/nodes', options)
command.response_representation = Google::Apis::TpuV1alpha1::ListNodesResponse::Representation
command.response_class = Google::Apis::TpuV1alpha1::ListNodesResponse
command.params['parent'] = parent unless parent.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Reimage a node's OS.
# @param [String] name
# The resource name.
# @param [String] tensorflow_version
# The version for reimage to create.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def reimage_project_location_node(name, tensorflow_version: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1alpha1/{+name}:reimage', options)
command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
command.response_class = Google::Apis::TpuV1alpha1::Operation
command.params['name'] = name unless name.nil?
command.query['tensorflowVersion'] = tensorflow_version unless tensorflow_version.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Resets a node, which stops and starts the VM.
# @param [String] name
# The resource name.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def reset_project_location_node(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1alpha1/{+name}:reset', options)
command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
command.response_class = Google::Apis::TpuV1alpha1::Operation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Starts asynchronous cancellation on a long-running operation. The server
# makes a best effort to cancel the operation, but success is not
# guaranteed. If the server doesn't support this method, it returns
# `google.rpc.Code.UNIMPLEMENTED`. Clients can use
# Operations.GetOperation or
# other methods to check whether the cancellation succeeded or whether the
# operation completed despite cancellation. On successful cancellation,
# the operation is not deleted; instead, it becomes an operation with
# an Operation.error value with a google.rpc.Status.code of 1,
# corresponding to `Code.CANCELLED`.
# @param [String] name
# The name of the operation resource to be cancelled.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Empty]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def cancel_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v1alpha1/{+name}:cancel', options)
command.response_representation = Google::Apis::TpuV1alpha1::Empty::Representation
command.response_class = Google::Apis::TpuV1alpha1::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes a long-running operation. This method indicates that the client is
# no longer interested in the operation result. It does not cancel the
# operation. If the server doesn't support this method, it returns
# `google.rpc.Code.UNIMPLEMENTED`.
# @param [String] name
# The name of the operation resource to be deleted.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Empty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Empty]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v1alpha1/{+name}', options)
command.response_representation = Google::Apis::TpuV1alpha1::Empty::Representation
command.response_class = Google::Apis::TpuV1alpha1::Empty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the latest state of a long-running operation. Clients can use this
# method to poll the operation result at intervals as recommended by the API
# service.
# @param [String] name
# The name of the operation resource.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::Operation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::Operation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1alpha1/{+name}', options)
command.response_representation = Google::Apis::TpuV1alpha1::Operation::Representation
command.response_class = Google::Apis::TpuV1alpha1::Operation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists operations that match the specified filter in the request. If the
# server doesn't support this method, it returns `UNIMPLEMENTED`.
# NOTE: the `name` binding allows API services to override the binding
# to use different resource name schemes, such as `users/*/operations`. To
# override the binding, API services can add a binding such as
# `"/v1/`name=users/*`/operations"` to their service configuration.
# For backwards compatibility, the default name includes the operations
# collection id, however overriding users must ensure the name binding
# is the parent resource, without the operations collection id.
# @param [String] name
# The name of the operation's parent resource.
# @param [String] filter
# The standard list filter.
# @param [Fixnum] page_size
# The standard list page size.
# @param [String] page_token
# The standard list page token.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::TpuV1alpha1::ListOperationsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::TpuV1alpha1::ListOperationsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v1alpha1/{+name}/operations', options)
command.response_representation = Google::Apis::TpuV1alpha1::ListOperationsResponse::Representation
command.response_class = Google::Apis::TpuV1alpha1::ListOperationsResponse
command.params['name'] = name unless name.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
protected
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
end
end
end
end
end