public sealed class GkePlatformDetails
Google Container (Kubernetes) Engine details.
Namespace
Google.Api.GaxAssembly
Google.Api.Gax.dll
Constructors
GkePlatformDetails(String, String, String, String, String, String, String, String, String, String, String)
public GkePlatformDetails(string metadataJson, string projectId, string clusterName, string location, string hostName, string instanceId, string zone, string namespaceId, string podId, string containerName, string clusterLocation)
Construct details of Google Container (Kubernetes) Engine
Parameters | |
---|---|
Name | Description |
metadataJson | String The full JSON string retrieved from the metadata server. Must not be |
projectId | String The project ID. Must not be |
clusterName | String The cluster name. Must not be |
location | String The location. Must not be |
hostName | String The instance host name. Must not be |
instanceId | String The GCE instance ID. Must not be |
zone | String The zone. Must not be |
namespaceId | String The kubernetes namespace ID. Must not be |
podId | String The kubernetes pod ID. Must not be |
containerName | String The container name. Must not be |
clusterLocation | String The location of the cluster. Must not be null. |
Properties
ClusterLocation
public string ClusterLocation { get; }
The location of the cluster. May be different from node / pod location.
Property Value | |
---|---|
Type | Description |
String |
ClusterName
public string ClusterName { get; }
The cluster name, which is visible in the Google Cloud Platform Console.
Property Value | |
---|---|
Type | Description |
String |
ContainerName
public string ContainerName { get; }
The name of the container.
Property Value | |
---|---|
Type | Description |
String |
HostName
public string HostName { get; }
The hostname of this instance.
Property Value | |
---|---|
Type | Description |
String |
InstanceId
public string InstanceId { get; }
The GCE instance this container is running in.
Property Value | |
---|---|
Type | Description |
String |
Location
public string Location { get; }
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
Property Value | |
---|---|
Type | Description |
String |
MetadataJson
public string MetadataJson { get; }
The full JSON string retrieved from the metadata server.
Property Value | |
---|---|
Type | Description |
String |
NamespaceId
public string NamespaceId { get; }
The cluster namespace the container is running in.
Property Value | |
---|---|
Type | Description |
String |
PodId
public string PodId { get; }
The pos the container is running in.
Property Value | |
---|---|
Type | Description |
String |
ProjectId
public string ProjectId { get; }
The Project ID associated with your application, which is visible in the Google Cloud Platform Console.
Property Value | |
---|---|
Type | Description |
String |
Zone
public string Zone { get; }
The GCE zone in which the instance is running. This is in the format
projects/<project-number>/zones/<zone-name>
.
Property Value | |
---|---|
Type | Description |
String |
Methods
ToString()
public override string ToString()
Returns | |
---|---|
Type | Description |
String |
TryLoad(String, GkePlatformDetails.KubernetesData)
public static GkePlatformDetails TryLoad(string metadataJson, GkePlatformDetails.KubernetesData 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 Empty for GkePlatformDetails
properties whose corresponding information is corrupt or missing in metadataJson
or kubernetesData
.
Parameters | |
---|---|
Name | Description |
metadataJson | String JSON metadata, normally retrieved from the GCE metadata server.
Must not be |
kubernetesData | GkePlatformDetails.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;
|