Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions google/cloud/shell_v1/services/cloud_shell_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,26 @@ async def get_environment(
r"""Gets an environment. Returns NOT_FOUND if the environment does
not exist.


.. code-block::

from google.cloud import shell_v1

def sample_get_environment():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.GetEnvironmentRequest(
name="name_value",
)

# Make the request
response = client.get_environment(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.GetEnvironmentRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -318,6 +338,29 @@ async def start_environment(
connections, the operation will contain a
StartEnvironmentResponse in its response field.


.. code-block::

from google.cloud import shell_v1

def sample_start_environment():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.StartEnvironmentRequest(
)

# Make the request
operation = client.start_environment(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.StartEnvironmentRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -382,6 +425,29 @@ async def authorize_environment(
line tools without requiring the user to manually
authenticate.


.. code-block::

from google.cloud import shell_v1

def sample_authorize_environment():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.AuthorizeEnvironmentRequest(
)

# Make the request
operation = client.authorize_environment(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.AuthorizeEnvironmentRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -444,6 +510,29 @@ async def add_public_key(
SSH. If a key with the same content already exists, this will
error with ALREADY_EXISTS.


.. code-block::

from google.cloud import shell_v1

def sample_add_public_key():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.AddPublicKeyRequest(
)

# Make the request
operation = client.add_public_key(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.AddPublicKeyRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -508,6 +597,29 @@ async def remove_public_key(
corresponding private key. If a key with the same content is not
present, this will error with NOT_FOUND.


.. code-block::

from google.cloud import shell_v1

def sample_remove_public_key():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.RemovePublicKeyRequest(
)

# Make the request
operation = client.remove_public_key(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.RemovePublicKeyRequest, dict]):
The request object. Request message for
Expand Down
117 changes: 117 additions & 0 deletions google/cloud/shell_v1/services/cloud_shell_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,27 @@ def get_environment(
r"""Gets an environment. Returns NOT_FOUND if the environment does
not exist.



.. code-block::

from google.cloud import shell_v1

def sample_get_environment():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.GetEnvironmentRequest(
name="name_value",
)

# Make the request
response = client.get_environment(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.GetEnvironmentRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -503,6 +524,30 @@ def start_environment(
connections, the operation will contain a
StartEnvironmentResponse in its response field.



.. code-block::

from google.cloud import shell_v1

def sample_start_environment():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.StartEnvironmentRequest(
)

# Make the request
operation = client.start_environment(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.StartEnvironmentRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -568,6 +613,30 @@ def authorize_environment(
line tools without requiring the user to manually
authenticate.



.. code-block::

from google.cloud import shell_v1

def sample_authorize_environment():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.AuthorizeEnvironmentRequest(
)

# Make the request
operation = client.authorize_environment(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.AuthorizeEnvironmentRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -631,6 +700,30 @@ def add_public_key(
SSH. If a key with the same content already exists, this will
error with ALREADY_EXISTS.



.. code-block::

from google.cloud import shell_v1

def sample_add_public_key():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.AddPublicKeyRequest(
)

# Make the request
operation = client.add_public_key(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.AddPublicKeyRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -696,6 +789,30 @@ def remove_public_key(
corresponding private key. If a key with the same content is not
present, this will error with NOT_FOUND.



.. code-block::

from google.cloud import shell_v1

def sample_remove_public_key():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.RemovePublicKeyRequest(
)

# Make the request
operation = client.remove_public_key(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

Args:
request (Union[google.cloud.shell_v1.types.RemovePublicKeyRequest, dict]):
The request object. Request message for
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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.
#
# Generated code. DO NOT EDIT!
#
# Snippet for AddPublicKey
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-shell


# [START cloudshell_generated_shell_v1_CloudShellService_AddPublicKey_async]
from google.cloud import shell_v1


async def sample_add_public_key():
# Create a client
client = shell_v1.CloudShellServiceAsyncClient()

# Initialize request argument(s)
request = shell_v1.AddPublicKeyRequest(
)

# Make the request
operation = client.add_public_key(request=request)

print("Waiting for operation to complete...")

response = await operation.result()

# Handle the response
print(response)

# [END cloudshell_generated_shell_v1_CloudShellService_AddPublicKey_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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.
#
# Generated code. DO NOT EDIT!
#
# Snippet for AddPublicKey
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-shell


# [START cloudshell_generated_shell_v1_CloudShellService_AddPublicKey_sync]
from google.cloud import shell_v1


def sample_add_public_key():
# Create a client
client = shell_v1.CloudShellServiceClient()

# Initialize request argument(s)
request = shell_v1.AddPublicKeyRequest(
)

# Make the request
operation = client.add_public_key(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

# [END cloudshell_generated_shell_v1_CloudShellService_AddPublicKey_sync]
Loading