Class SessionControllerClient (2.26.0)

The SessionController provides methods to manage interactive sessions.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

SessionControllerClient(SessionControllerClient const &)

Copy and move support

Parameter
Name Description
SessionControllerClient const &

SessionControllerClient(SessionControllerClient &&)

Copy and move support

Parameter
Name Description
SessionControllerClient &&

SessionControllerClient(std::shared_ptr< SessionControllerConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< SessionControllerConnection >
opts Options

Operators

operator=(SessionControllerClient const &)

Copy and move support

Parameter
Name Description
SessionControllerClient const &
Returns
Type Description
SessionControllerClient &

operator=(SessionControllerClient &&)

Copy and move support

Parameter
Name Description
SessionControllerClient &&
Returns
Type Description
SessionControllerClient &

Functions

CreateSession(std::string const &, google::cloud::dataproc::v1::Session const &, std::string const &, Options)

Create an interactive session asynchronously.

Parameters
Name Description
parent std::string const &

Required. The parent resource where this session will be created.

session google::cloud::dataproc::v1::Session const &

Required. The interactive session to create.

session_id std::string const &

Required. The ID to use for the session, which becomes the final component of the session's resource name.
This value must be 4-63 characters. Valid characters are /[a-z][0-9]-/.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.Session proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateSession(ExperimentalTag, NoAwaitTag, std::string const &, google::cloud::dataproc::v1::Session const &, std::string const &, Options)

Create an interactive session asynchronously.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
ExperimentalTag
NoAwaitTag
parent std::string const &
session google::cloud::dataproc::v1::Session const &
session_id std::string const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateSession(google::cloud::dataproc::v1::CreateSessionRequest const &, Options)

Create an interactive session asynchronously.

Parameters
Name Description
request google::cloud::dataproc::v1::CreateSessionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.CreateSessionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.Session proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateSession(ExperimentalTag, NoAwaitTag, google::cloud::dataproc::v1::CreateSessionRequest const &, Options)

Create an interactive session asynchronously.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
ExperimentalTag
NoAwaitTag
request google::cloud::dataproc::v1::CreateSessionRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateSession(ExperimentalTag, google::longrunning::Operation const &, Options)

Create an interactive session asynchronously.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
ExperimentalTag
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >

GetSession(std::string const &, Options)

Gets the resource representation for an interactive session.

Parameters
Name Description
name std::string const &

Required. The name of the session to retrieve.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::dataproc::v1::Session >

the result of the RPC. The response message type (google.cloud.dataproc.v1.Session) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetSession(google::cloud::dataproc::v1::GetSessionRequest const &, Options)

Gets the resource representation for an interactive session.

Parameters
Name Description
request google::cloud::dataproc::v1::GetSessionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.GetSessionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::dataproc::v1::Session >

the result of the RPC. The response message type (google.cloud.dataproc.v1.Session) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListSessions(std::string const &, Options)

Lists interactive sessions.

Parameters
Name Description
parent std::string const &

Required. The parent, which owns this collection of sessions.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::dataproc::v1::Session >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.dataproc.v1.Session, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListSessions(google::cloud::dataproc::v1::ListSessionsRequest, Options)

Lists interactive sessions.

Parameters
Name Description
request google::cloud::dataproc::v1::ListSessionsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.ListSessionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::dataproc::v1::Session >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.dataproc.v1.Session, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

TerminateSession(std::string const &, Options)

Terminates the interactive session.

Parameters
Name Description
name std::string const &

Required. The name of the session resource to terminate.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.Session proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

TerminateSession(ExperimentalTag, NoAwaitTag, std::string const &, Options)

Terminates the interactive session.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
ExperimentalTag
NoAwaitTag
name std::string const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

TerminateSession(google::cloud::dataproc::v1::TerminateSessionRequest const &, Options)

Terminates the interactive session.

Parameters
Name Description
request google::cloud::dataproc::v1::TerminateSessionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.TerminateSessionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.Session proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

TerminateSession(ExperimentalTag, NoAwaitTag, google::cloud::dataproc::v1::TerminateSessionRequest const &, Options)

Terminates the interactive session.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
ExperimentalTag
NoAwaitTag
request google::cloud::dataproc::v1::TerminateSessionRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

TerminateSession(ExperimentalTag, google::longrunning::Operation const &, Options)

Terminates the interactive session.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
ExperimentalTag
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >

DeleteSession(std::string const &, Options)

Deletes the interactive session resource.

If the session is not in terminal state, it is terminated, and then deleted.

Parameters
Name Description
name std::string const &

Required. The name of the session resource to delete.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.Session proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteSession(ExperimentalTag, NoAwaitTag, std::string const &, Options)

Deletes the interactive session resource.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
ExperimentalTag
NoAwaitTag
name std::string const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

DeleteSession(google::cloud::dataproc::v1::DeleteSessionRequest const &, Options)

Deletes the interactive session resource.

If the session is not in terminal state, it is terminated, and then deleted.

Parameters
Name Description
request google::cloud::dataproc::v1::DeleteSessionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.dataproc.v1.DeleteSessionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.dataproc.v1.Session proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteSession(ExperimentalTag, NoAwaitTag, google::cloud::dataproc::v1::DeleteSessionRequest const &, Options)

Deletes the interactive session resource.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
ExperimentalTag
NoAwaitTag
request google::cloud::dataproc::v1::DeleteSessionRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

DeleteSession(ExperimentalTag, google::longrunning::Operation const &, Options)

Deletes the interactive session resource.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
ExperimentalTag
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::cloud::dataproc::v1::Session > >