Show / Hide Table of Contents

Class Project

Operations for Cloud Console Projects.

Inheritance
System.Object
Project
Inherited Members
System.Object.ToString()
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Cloud.Diagnostics.Common
Assembly: Google.Cloud.Diagnostics.Common.dll
Syntax
public static class Project

Methods

GetAndCheckProjectId(String, MonitoredResource)

Determines the correct project id from a string project id and a . If the specified project id is not null, it is returned. Otherwise, if the project id of the MonitoredResource is not null, it is returned. It both are null, an System.InvalidOperationException is thrown.

Declaration
public static string GetAndCheckProjectId(string projectId, MonitoredResource monitoredResource = null)
Parameters
Type Name Description
System.String projectId

The Google Cloud project ID. Can be null.

MonitoredResource monitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
Type Description
System.String

The Google Cloud project ID.

GetAndCheckServiceName(String, MonitoredResource)

Determines the correct service name from a string serviceName and a . If the specified service name is not null, it is returned. Otherwise, if the service name of the MonitoredResource is not null, it is returned. It both are null, an System.InvalidOperationException is thrown.

Declaration
public static string GetAndCheckServiceName(string serviceName, MonitoredResource monitoredResource = null)
Parameters
Type Name Description
System.String serviceName

The service name. Can be null.

MonitoredResource monitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
Type Description
System.String

The service name that was passed in or detected.

GetAndCheckServiceVersion(String, MonitoredResource)

Determines the correct service version from a string serviceVersion and a . If the specified service version is not null, it is returned. Otherwise, if the service version of the MonitoredResource provided or detected is not null, it is returned. It both are null, an System.InvalidOperationException is thrown.

Declaration
public static string GetAndCheckServiceVersion(string serviceVersion, MonitoredResource monitoredResource = null)
Parameters
Type Name Description
System.String serviceVersion

The service version. Can be null.

MonitoredResource monitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
Type Description
System.String

The Google App Engine service version.

GetProjectId(String, MonitoredResource)

Determines the correct project ID from a string projectId and a . If the specified project ID is not null, it is returned. Otherwise, if the project ID of the MonitoredResource is not null, it is returned. It both are null, null is returned.

Declaration
public static string GetProjectId(string projectId, MonitoredResource monitoredResource = null)
Parameters
Type Name Description
System.String projectId

The project ID. Can be null.

MonitoredResource monitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
Type Description
System.String

The Google Cloud project ID.

GetServiceName(String, MonitoredResource)

Determines the correct service name from a string serviceName and a . If the specified service name is not null, it is returned. Otherwise, if the service name of the MonitoredResource is not null, it is returned. It both are null, null is returned.

Declaration
public static string GetServiceName(string serviceName, MonitoredResource monitoredResource = null)
Parameters
Type Name Description
System.String serviceName

The service name. Can be null.

MonitoredResource monitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
Type Description
System.String

The service name that was passed in or detected.

GetServiceVersion(String, MonitoredResource)

Determines the correct service version from a string serviceVersion and a . If the specified service version is not null, it is returned. Otherwise, if the service version of the MonitoredResource provided or detected is not null, it is returned. It both are null, null is resturned.

Declaration
public static string GetServiceVersion(string serviceVersion, MonitoredResource monitoredResource = null)
Parameters
Type Name Description
System.String serviceVersion

The service version. Can be null.

MonitoredResource monitoredResource

Optional, The monitored resource. If unset the monitored resource will be auto detected.

Returns
Type Description
System.String

The service version that was passed in or detected.

Back to top