Show / Hide Table of Contents

Class GkePlatformDetails

Google Container (Kubernetes) Engine details.

Inheritance
System.Object
GkePlatformDetails
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api.Gax
Assembly: Google.Api.Gax.dll
Syntax
public sealed class GkePlatformDetails

Constructors

GkePlatformDetails(String, String, String, String, String)

Construct details of Google Container (Kubernetes) Engine

Declaration
[Obsolete("Only partially fills instance with data; use alternative constructor.")]
public GkePlatformDetails(string metadataJson, string projectId, string clusterName, string location, string hostName)
Parameters
Type Name Description
System.String metadataJson

The full JSON string retrieved from the metadata server. Must not be null.

System.String projectId

The project ID. Must not be null.

System.String clusterName

The cluster name. Must not be null.

System.String location

The location. Must not be null.

System.String hostName

The instance host name. Must not be null.

GkePlatformDetails(String, String, String, String, String, String, String, String, String, String)

Construct details of Google Container (Kubernetes) Engine

Declaration
public GkePlatformDetails(string metadataJson, string projectId, string clusterName, string location, string hostName, string instanceId, string zone, string namespaceId, string podId, string containerName)
Parameters
Type Name Description
System.String metadataJson

The full JSON string retrieved from the metadata server. Must not be null.

System.String projectId

The project ID. Must not be null.

System.String clusterName

The cluster name. Must not be null.

System.String location

The location. Must not be null.

System.String hostName

The instance host name. Must not be null.

System.String instanceId

The GCE instance ID. Must not be null.

System.String zone

The zone. Must not be null.

System.String namespaceId

The kubernetes namespace ID. Must not be null.

System.String podId

The kubernetes pod ID. Must not be null.

System.String containerName

The container name. Must not be null.

Properties

ClusterName

The cluster name, which is visible in the Google Cloud Platform Console.

Declaration
public string ClusterName { get; }
Property Value
Type Description
System.String

ContainerName

The name of the container.

Declaration
public string ContainerName { get; }
Property Value
Type Description
System.String

HostName

The hostname of this instance.

Declaration
public string HostName { get; }
Property Value
Type Description
System.String

InstanceId

The GCE instance this container is running in.

Declaration
public string InstanceId { get; }
Property Value
Type Description
System.String

Location

The cluster location, which is visible in the Google Cloud Platform Console. This is equivalent to the value of the

<zone-name>
part in Zone

Declaration
public string Location { get; }
Property Value
Type Description
System.String

MetadataJson

The full JSON string retrieved from the metadata server.

Declaration
public string MetadataJson { get; }
Property Value
Type Description
System.String

NamespaceId

The cluster namespace the container is running in.

Declaration
public string NamespaceId { get; }
Property Value
Type Description
System.String

PodId

The pos the container is running in.

Declaration
public string PodId { get; }
Property Value
Type Description
System.String

ProjectId

The Project ID associated with your application, which is visible in the Google Cloud Platform Console.

Declaration
public string ProjectId { get; }
Property Value
Type Description
System.String

Zone

The GCE zone in which the instance is running. This is in the format

projects/<project-number>/zones/<zone-name>
.

Declaration
public string Zone { get; }
Property Value
Type Description
System.String

Methods

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

TryLoad(String)

Builds a GkePlatformDetails from the given metadata. This metadata is normally retrieved from the GCE metadata server.

Declaration
[Obsolete("Use TryLoad(string, KubernetesData) instead.")]
public static GkePlatformDetails TryLoad(string metadataJson)
Parameters
Type Name Description
System.String metadataJson

JSON metadata, normally retrieved from the GCE metadata server.

Returns
Type Description
GkePlatformDetails

A populated GkePlatformDetails if the metadata represents and GKE instance; null otherwise.

TryLoad(String, GkePlatformDetails.KubernetesData)

Builds a GkePlatformDetails from the given metadata and kubernetes data. The metadata is normally retrieved from the GCE metadata server. The kubernetes data is normally retrieved using the kubernetes API. This method attempts to return as much information as it is present on metadataJson and kubernetesData but will return System.String.Empty for GkePlatformDetails properties whose corresponding information is corrupt or missing in metadataJson or kubernetesData.

Declaration
public static GkePlatformDetails TryLoad(string metadataJson, GkePlatformDetails.KubernetesData kubernetesData)
Parameters
Type Name Description
System.String metadataJson

JSON metadata, normally retrieved from the GCE metadata server. Must not be null.

GkePlatformDetails.KubernetesData kubernetesData

Kubernetes data, normally retrieved using the kubernetes API. Must not be null.

Returns
Type Description
GkePlatformDetails

A populated GkePlatformDetails if the metadata represents and GKE instance; null otherwise.

Back to top