public sealed class GcePlatformDetailsGoogle Compute Engine details.
Namespace
Google.Api.GaxAssembly
Google.Api.Gax.dll
Constructors
GcePlatformDetails(String, String, String, String)
public GcePlatformDetails(string metadataJson, string projectId, string instanceId, string zoneName)Construct details of Google Compute Engine
| Parameters | |
|---|---|
| Name | Description |
metadataJson |
StringThe full JSON string retrieved from the metadata server. Must not be |
projectId |
StringThe project ID. Must not be |
instanceId |
StringThe instance ID. Must not be |
zoneName |
StringThe zone name. Must not be |
Properties
InstanceId
public string InstanceId { get; }The Instance ID of the GCE instance on which this is running. This is never null.
| Property Value | |
|---|---|
| Type | Description |
String |
|
Location
public string Location { get; }The zone name where this GCE instance is running. If ZoneName is in the format
projects/<project-number>/zones/<zone-name><zone-name>| Property Value | |
|---|---|
| Type | Description |
String |
|
MetadataJson
public string MetadataJson { get; }The full JSON string retrieved from the metadata server. This is never null.
| Property Value | |
|---|---|
| Type | Description |
String |
|
ProjectId
public string ProjectId { get; }The Project ID under which this GCE instance is running. This is never null.
| Property Value | |
|---|---|
| Type | Description |
String |
|
ZoneName
public string ZoneName { get; }The zone where this GCE instance is running. This is never null. This will be 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)
public static GcePlatformDetails TryLoad(string metadataJson)Builds a GcePlatformDetails from the given metadata. This metadata is normally retrieved from the GCE metadata server.
| Parameter | |
|---|---|
| Name | Description |
metadataJson |
StringJSON metadata, normally retrieved from the GCE metadata server.
Must not be |
| Returns | |
|---|---|
| Type | Description |
GcePlatformDetails |
A populated GcePlatformDetails if the metadata represents and GCE instance;
|