Reference documentation and code samples for the Device Streaming V1 API class Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.
REST client for the DirectAccessService service.
A service for allocating Android devices and interacting with the live-allocated devices.
Each Session will wait for available capacity, at a higher priority over Test Execution. When allocated, the session will be exposed through a stream for integration.
DirectAccessService is currently available as a preview to select developers. You can register today on behalf of you and your team at https://developer.android.com/studio/preview/android-device-streaming
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the DirectAccessService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all DirectAccessService clients ::Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.configure do |config| config.timeout = 10.0 end
#cancel_device_session
def cancel_device_session(request, options = nil) -> ::Google::Protobuf::Empty
def cancel_device_session(name: nil) -> ::Google::Protobuf::Empty
Cancel a DeviceSession. This RPC changes the DeviceSession to state FINISHED and terminates all connections. Canceled sessions are not deleted and can be retrieved or listed by the user until they expire based on the 28 day deletion policy.
def cancel_device_session(request, options = nil) -> ::Google::Protobuf::Empty
cancel_device_session
via a request object, either of type
CancelDeviceSessionRequest or an equivalent Hash.
- request (::Google::Cloud::DeviceStreaming::V1::CancelDeviceSessionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def cancel_device_session(name: nil) -> ::Google::Protobuf::Empty
cancel_device_session
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. Name of the DeviceSession, e.g. "projects/{project_id}/deviceSessions/{session_id}"
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/device_streaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DeviceStreaming::V1::CancelDeviceSessionRequest.new # Call the cancel_device_session method. result = client.cancel_device_session request # The returned object is of type Google::Protobuf::Empty. p result
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the DirectAccessService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_device_session
def create_device_session(request, options = nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
def create_device_session(parent: nil, device_session: nil, device_session_id: nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
Creates a DeviceSession.
def create_device_session(request, options = nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
create_device_session
via a request object, either of type
CreateDeviceSessionRequest or an equivalent Hash.
- request (::Google::Cloud::DeviceStreaming::V1::CreateDeviceSessionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_device_session(parent: nil, device_session: nil, device_session_id: nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
create_device_session
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — Required. The Compute Engine project under which this device will be allocated. "projects/{project_id}"
- device_session (::Google::Cloud::DeviceStreaming::V1::DeviceSession, ::Hash) — Required. A DeviceSession to create.
-
device_session_id (::String) — Optional. The ID to use for the DeviceSession, which will become the final
component of the DeviceSession's resource name.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DeviceStreaming::V1::DeviceSession)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/device_streaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DeviceStreaming::V1::CreateDeviceSessionRequest.new # Call the create_device_session method. result = client.create_device_session request # The returned object is of type Google::Cloud::DeviceStreaming::V1::DeviceSession. p result
#get_device_session
def get_device_session(request, options = nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
def get_device_session(name: nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
Gets a DeviceSession, which documents the allocation status and whether the device is allocated. Clients making requests from this API must poll GetDeviceSession.
def get_device_session(request, options = nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
get_device_session
via a request object, either of type
GetDeviceSessionRequest or an equivalent Hash.
- request (::Google::Cloud::DeviceStreaming::V1::GetDeviceSessionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_device_session(name: nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
get_device_session
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. Name of the DeviceSession, e.g. "projects/{project_id}/deviceSessions/{session_id}"
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DeviceStreaming::V1::DeviceSession)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/device_streaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DeviceStreaming::V1::GetDeviceSessionRequest.new # Call the get_device_session method. result = client.get_device_session request # The returned object is of type Google::Cloud::DeviceStreaming::V1::DeviceSession. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new DirectAccessService REST client object.
- (config) — Configure the DirectAccessService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_device_sessions
def list_device_sessions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeviceStreaming::V1::DeviceSession>
def list_device_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeviceStreaming::V1::DeviceSession>
Lists DeviceSessions owned by the project user.
def list_device_sessions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeviceStreaming::V1::DeviceSession>
list_device_sessions
via a request object, either of type
ListDeviceSessionsRequest or an equivalent Hash.
- request (::Google::Cloud::DeviceStreaming::V1::ListDeviceSessionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_device_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeviceStreaming::V1::DeviceSession>
list_device_sessions
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — Required. The name of the parent to request, e.g. "projects/{project_id}"
- page_size (::Integer) — Optional. The maximum number of DeviceSessions to return.
- page_token (::String) — Optional. A continuation token for paging.
- filter (::String) — Optional. If specified, responses will be filtered by the given filter. Allowed fields are: session_state.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeviceStreaming::V1::DeviceSession>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::DeviceStreaming::V1::DeviceSession>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/device_streaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DeviceStreaming::V1::ListDeviceSessionsRequest.new # Call the list_device_sessions method. result = client.list_device_sessions request # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.each do |item| # Each element is of type ::Google::Cloud::DeviceStreaming::V1::DeviceSession. p item end
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_device_session
def update_device_session(request, options = nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
def update_device_session(device_session: nil, update_mask: nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
Updates the current DeviceSession to the fields described by the update_mask.
def update_device_session(request, options = nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
update_device_session
via a request object, either of type
UpdateDeviceSessionRequest or an equivalent Hash.
- request (::Google::Cloud::DeviceStreaming::V1::UpdateDeviceSessionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_device_session(device_session: nil, update_mask: nil) -> ::Google::Cloud::DeviceStreaming::V1::DeviceSession
update_device_session
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
device_session (::Google::Cloud::DeviceStreaming::V1::DeviceSession, ::Hash) — Required. DeviceSession to update.
The DeviceSession's
name
field is used to identify the session to update "projects/{project_id}/deviceSessions/{session_id}" - update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. The list of fields to update.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::DeviceStreaming::V1::DeviceSession)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/device_streaming/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::DeviceStreaming::V1::DirectAccessService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DeviceStreaming::V1::UpdateDeviceSessionRequest.new # Call the update_device_session method. result = client.update_device_session request # The returned object is of type Google::Cloud::DeviceStreaming::V1::DeviceSession. p result