4.10.0 (latest) 4.8.0 4.4.0 4.3.1 4.2.0 4.0.0 3.2.0

    public sealed class GcePlatformDetails

Google Compute Engine details.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> GcePlatformDetails

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)

## Namespace

[Google.Api.Gax](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.md.txt)

## Assembly

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` | `string` The full JSON string retrieved from the metadata server. Must not be `null`. |
| `projectId` | `string` The project ID. Must not be `null`. |
| `instanceId` | `string` The instance ID. Must not be `null`. |
| `zoneName` | `string` The zone name. Must not be `null`. If this value is in the format ```csharp projects/<project-number>/zones/<zone-name> ``` then [Location](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.GcePlatformDetails.md.txt#Google_Api_Gax_GcePlatformDetails_Location) will return the ```csharp <zone-name> ``` part of this value. If not, [Location](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.GcePlatformDetails.md.txt#Google_Api_Gax_GcePlatformDetails_Location) will throw [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception). If this value has been retrived from Google Compute Engine, the it's format will be the one described above. <br /> |

## 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.GcePlatformDetails.md.txt#Google_Api_Gax_GcePlatformDetails_ZoneName) is in the format

```csharp
projects/<project-number>/zones/<zone-name>
```
this value will be the

```csharp
<zone-name>
```
part in [ZoneName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.GcePlatformDetails.md.txt#Google_Api_Gax_GcePlatformDetails_ZoneName). If [ZoneName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.GcePlatformDetails.md.txt#Google_Api_Gax_GcePlatformDetails_ZoneName) is in a different format then this getting the value of this property will throw [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception).

<br />

| **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

```csharp
projects/<project-number>/zones/<zone-name>
```
id the value has been retrieved from Google Compute Engine.

<br />

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

## Methods

### ToString()

    public override string ToString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

**Overrides** [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

### TryLoad(string)

    public static GcePlatformDetails TryLoad(string metadataJson)

Builds a [GcePlatformDetails](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.GcePlatformDetails.md.txt) from the given metadata.
This metadata is normally retrieved from the GCE metadata server.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `metadataJson` | `string` JSON metadata, normally retrieved from the GCE metadata server. Must not be `null`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `GcePlatformDetails` | A populated [GcePlatformDetails](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.GcePlatformDetails.md.txt) if the metadata represents and GCE instance; `null` otherwise. |