Google Cloud Monitoring v3 API - Class GroupServiceClient (3.3.0)

public abstract class GroupServiceClient

Reference documentation and code samples for the Google Cloud Monitoring v3 API class GroupServiceClient.

GroupService client wrapper, for convenient use.

Inheritance

object > GroupServiceClient

Derived Types

Namespace

Google.Cloud.Monitoring.V3

Assembly

Google.Cloud.Monitoring.V3.dll

Remarks

The Group API lets you inspect and manage your groups.

A group is a named filter that is used to identify a collection of monitored resources. Groups are typically used to mirror the physical and/or logical topology of the environment. Because group membership is computed dynamically, monitored resources that are started in the future are automatically placed in matching groups. By using a group to name monitored resources in, for example, an alert policy, the target of that alert policy is updated automatically as monitored resources are added and removed from the infrastructure.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the GroupService service, which is a host of "monitoring.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default GroupService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

GrpcClient

public virtual GroupService.GroupServiceClient GrpcClient { get; }

The underlying gRPC GroupService client

Property Value
TypeDescription
GroupServiceGroupServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static GroupServiceClient Create()

Synchronously creates a GroupServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use GroupServiceClientBuilder.

Returns
TypeDescription
GroupServiceClient

The created GroupServiceClient.

CreateAsync(CancellationToken)

public static Task<GroupServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a GroupServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use GroupServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskGroupServiceClient

The task representing the created GroupServiceClient.

CreateGroup(IResourceName, Group, CallSettings)

public virtual Group CreateGroup(IResourceName name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
nameIResourceName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Group

The RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
Group group = new Group();
// Make the request
Group response = groupServiceClient.CreateGroup(name, group);

CreateGroup(FolderName, Group, CallSettings)

public virtual Group CreateGroup(FolderName name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
nameFolderName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Group

The RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
Group group = new Group();
// Make the request
Group response = groupServiceClient.CreateGroup(name, group);

CreateGroup(OrganizationName, Group, CallSettings)

public virtual Group CreateGroup(OrganizationName name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
nameOrganizationName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Group

The RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
Group group = new Group();
// Make the request
Group response = groupServiceClient.CreateGroup(name, group);

CreateGroup(ProjectName, Group, CallSettings)

public virtual Group CreateGroup(ProjectName name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
nameProjectName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Group

The RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
Group group = new Group();
// Make the request
Group response = groupServiceClient.CreateGroup(name, group);

CreateGroup(CreateGroupRequest, CallSettings)

public virtual Group CreateGroup(CreateGroupRequest request, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
requestCreateGroupRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Group

The RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
CreateGroupRequest request = new CreateGroupRequest
{
    Group = new Group(),
    ValidateOnly = false,
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Group response = groupServiceClient.CreateGroup(request);

CreateGroup(string, Group, CallSettings)

public virtual Group CreateGroup(string name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
namestring

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Group

The RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
Group group = new Group();
// Make the request
Group response = groupServiceClient.CreateGroup(name, group);

CreateGroupAsync(IResourceName, Group, CallSettings)

public virtual Task<Group> CreateGroupAsync(IResourceName name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
nameIResourceName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskGroup

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
Group group = new Group();
// Make the request
Group response = await groupServiceClient.CreateGroupAsync(name, group);

CreateGroupAsync(IResourceName, Group, CancellationToken)

public virtual Task<Group> CreateGroupAsync(IResourceName name, Group group, CancellationToken cancellationToken)

Creates a new group.

Parameters
NameDescription
nameIResourceName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskGroup

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
Group group = new Group();
// Make the request
Group response = await groupServiceClient.CreateGroupAsync(name, group);

CreateGroupAsync(FolderName, Group, CallSettings)

public virtual Task<Group> CreateGroupAsync(FolderName name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
nameFolderName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskGroup

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
Group group = new Group();
// Make the request
Group response = await groupServiceClient.CreateGroupAsync(name, group);

CreateGroupAsync(FolderName, Group, CancellationToken)

public virtual Task<Group> CreateGroupAsync(FolderName name, Group group, CancellationToken cancellationToken)

Creates a new group.

Parameters
NameDescription
nameFolderName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskGroup

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
Group group = new Group();
// Make the request
Group response = await groupServiceClient.CreateGroupAsync(name, group);

CreateGroupAsync(OrganizationName, Group, CallSettings)

public virtual Task<Group> CreateGroupAsync(OrganizationName name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
nameOrganizationName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskGroup

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
Group group = new Group();
// Make the request
Group response = await groupServiceClient.CreateGroupAsync(name, group);

CreateGroupAsync(OrganizationName, Group, CancellationToken)

public virtual Task<Group> CreateGroupAsync(OrganizationName name, Group group, CancellationToken cancellationToken)

Creates a new group.

Parameters
NameDescription
nameOrganizationName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskGroup

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
Group group = new Group();
// Make the request
Group response = await groupServiceClient.CreateGroupAsync(name, group);

CreateGroupAsync(ProjectName, Group, CallSettings)

public virtual Task<Group> CreateGroupAsync(ProjectName name, Group group, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
nameProjectName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskGroup

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
Group group = new Group();
// Make the request
Group response = await groupServiceClient.CreateGroupAsync(name, group);

CreateGroupAsync(ProjectName, Group, CancellationToken)

public virtual Task<Group> CreateGroupAsync(ProjectName name, Group group, CancellationToken cancellationToken)

Creates a new group.

Parameters
NameDescription
nameProjectName

Required. The project in which to create the group. The format is:

projects/[PROJECT_ID_OR_NUMBER]

groupGroup

Required. A group definition. It is an error to define the name field because the system assigns the name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskGroup

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
Group group = new Group();
// Make the request
Group response = await groupServiceClient.CreateGroupAsync(name, group);

CreateGroupAsync(CreateGroupRequest, CallSettings)

public virtual Task<Group> CreateGroupAsync(CreateGroupRequest request, CallSettings callSettings = null)

Creates a new group.

Parameters
NameDescription
requestCreateGroupRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription