Class Environment (2.22.0)

public final class Environment extends GeneratedMessageV3 implements EnvironmentOrBuilder

A Cloud Shell environment, which is defined as the combination of a Docker image specifying what is installed on the environment and a home directory containing the user's data that will remain across sessions. Each user has at least an environment with the ID "default".

Protobuf type google.cloud.shell.v1.Environment

Static Fields

DOCKER_IMAGE_FIELD_NUMBER

public static final int DOCKER_IMAGE_FIELD_NUMBER
Field Value
TypeDescription
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

PUBLIC_KEYS_FIELD_NUMBER

public static final int PUBLIC_KEYS_FIELD_NUMBER
Field Value
TypeDescription
int

SSH_HOST_FIELD_NUMBER

public static final int SSH_HOST_FIELD_NUMBER
Field Value
TypeDescription
int

SSH_PORT_FIELD_NUMBER

public static final int SSH_PORT_FIELD_NUMBER
Field Value
TypeDescription
int

SSH_USERNAME_FIELD_NUMBER

public static final int SSH_USERNAME_FIELD_NUMBER
Field Value
TypeDescription
int

STATE_FIELD_NUMBER

public static final int STATE_FIELD_NUMBER
Field Value
TypeDescription
int

WEB_HOST_FIELD_NUMBER

public static final int WEB_HOST_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Environment getDefaultInstance()
Returns
TypeDescription
Environment

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Environment.Builder newBuilder()
Returns
TypeDescription
Environment.Builder

newBuilder(Environment prototype)

public static Environment.Builder newBuilder(Environment prototype)
Parameter
NameDescription
prototypeEnvironment
Returns
TypeDescription
Environment.Builder

parseDelimitedFrom(InputStream input)

public static Environment parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Environment
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Environment parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Environment
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Environment parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Environment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Environment parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Environment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Environment parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Environment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Environment parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Environment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Environment parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Environment
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Environment parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Environment
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Environment parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Environment
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Environment parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Environment
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Environment parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Environment
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Environment parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Environment
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Environment> parser()
Returns
TypeDescription
Parser<Environment>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Environment getDefaultInstanceForType()
Returns
TypeDescription
Environment

getDockerImage()

public String getDockerImage()

Required. Immutable. Full path to the Docker image used to run this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest".

string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
String

The dockerImage.

getDockerImageBytes()

public ByteString getDockerImageBytes()

Required. Immutable. Full path to the Docker image used to run this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest".

string docker_image = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
ByteString

The bytes for dockerImage.

getId()

public String getId()

Output only. The environment's identifier, unique among the user's environments.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The id.

getIdBytes()

public ByteString getIdBytes()

Output only. The environment's identifier, unique among the user's environments.

string id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for id.

getName()

public String getName()

Immutable. Full name of this resource, in the format users/{owner_email}/environments/{environment_id}. {owner_email} is the email address of the user to whom this environment belongs, and {environment_id} is the identifier of this environment. For example, users/someone@example.com/environments/default.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Immutable. Full name of this resource, in the format users/{owner_email}/environments/{environment_id}. {owner_email} is the email address of the user to whom this environment belongs, and {environment_id} is the identifier of this environment. For example, users/someone@example.com/environments/default.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
ByteString

The bytes for name.

getParserForType()

public Parser<Environment> getParserForType()
Returns
TypeDescription
Parser<Environment>
Overrides

getPublicKeys(int index)

public String getPublicKeys(int index)

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The publicKeys at the given index.

getPublicKeysBytes(int index)

public ByteString getPublicKeysBytes(int index)

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the publicKeys at the given index.

getPublicKeysCount()

public int getPublicKeysCount()

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The count of publicKeys.

getPublicKeysList()

public ProtocolStringList getPublicKeysList()

Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.

repeated string public_keys = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ProtocolStringList

A list containing the publicKeys.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getSshHost()

public String getSshHost()

Output only. Host to which clients can connect to initiate SSH sessions with the environment.

string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The sshHost.

getSshHostBytes()

public ByteString getSshHostBytes()

Output only. Host to which clients can connect to initiate SSH sessions with the environment.

string ssh_host = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for sshHost.

getSshPort()

public int getSshPort()

Output only. Port to which clients can connect to initiate SSH sessions with the environment.

int32 ssh_port = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The sshPort.

getSshUsername()

public String getSshUsername()

Output only. Username that clients should use when initiating SSH sessions with the environment.

string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The sshUsername.

getSshUsernameBytes()

public ByteString getSshUsernameBytes()

Output only. Username that clients should use when initiating SSH sessions with the environment.

string ssh_username = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for sshUsername.

getState()

public Environment.State getState()

Output only. Current execution state of this environment.

.google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Environment.State

The state.

getStateValue()

public int getStateValue()

Output only. Current execution state of this environment.

.google.cloud.shell.v1.Environment.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The enum numeric value on the wire for state.

getWebHost()

public String getWebHost()

Output only. Host to which clients can connect to initiate HTTPS or WSS connections with the environment.

string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
String

The webHost.

getWebHostBytes()

public ByteString getWebHostBytes()

Output only. Host to which clients can connect to initiate HTTPS or WSS connections with the environment.

string web_host = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ByteString

The bytes for webHost.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Environment.Builder newBuilderForType()
Returns
TypeDescription
Environment.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Environment.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Environment.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Environment.Builder toBuilder()
Returns
TypeDescription
Environment.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException