Class GkePlatformDetails
Google Container (Kubernetes) Engine details.
Inheritance
Inherited Members
Namespace: Google.Api.Gax
Assembly: Google.Api.Gax.dll
Syntax
public sealed class GkePlatformDetails
Constructors
GkePlatformDetails(String, 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, string clusterLocation)
Parameters
Type | Name | Description |
---|---|---|
System.String | metadataJson | The full JSON string retrieved from the metadata server. Must not be |
System.String | projectId | The project ID. Must not be |
System.String | clusterName | The cluster name. Must not be |
System.String | location | The location. Must not be |
System.String | hostName | The instance host name. Must not be |
System.String | instanceId | The GCE instance ID. Must not be |
System.String | zone | The zone. Must not be |
System.String | namespaceId | The kubernetes namespace ID. Must not be |
System.String | podId | The kubernetes pod ID. Must not be |
System.String | containerName | The container name. Must not be |
System.String | clusterLocation | The location of the cluster. Must not be null. |
Properties
ClusterLocation
The location of the cluster. May be different from node / pod location.
Declaration
public string ClusterLocation { get; }
Property Value
Type | Description |
---|---|
System.String |
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
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 |
GkePlatformDetails.KubernetesData | kubernetesData | Kubernetes data, normally retrieved using the kubernetes API.
Must not be |
Returns
Type | Description |
---|---|
GkePlatformDetails | A populated GkePlatformDetails if the metadata represents and GKE instance;
|