Google Cloud Monitoring v3 API - Class GroupServiceClient (3.2.0)

Stay organized with collections Save and categorize content based on your preferences.
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
IReadOnlyList<String>
Remarks

GrpcClient

public virtual GroupService.GroupServiceClient GrpcClient { get; }

The underlying gRPC GroupService client

Property Value
TypeDescription
GroupService.GroupServiceClient

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(CancellationToken))

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
Task<GroupServiceClient>

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
Task<Group>

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
Task<Group>

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
Task<Group>

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
Task<Group>

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
Task<Group>

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
Task<Group>

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
Task<Group>

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
Task<Group>

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
Task<Group>

A Task containing the RPC response.

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

CreateGroupAsync(CreateGroupRequest, CancellationToken)

public virtual Task<Group> CreateGroupAsync(CreateGroupRequest request, CancellationToken cancellationToken)

Creates a new group.

Parameters
NameDescription
requestCreateGroupRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Group>

A Task containing the RPC response.

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

CreateGroupAsync(String, Group, CallSettings)

public virtual Task<Group> CreateGroupAsync(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
Task<Group>

A Task containing the RPC response.

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

CreateGroupAsync(String, Group, CancellationToken)

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

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Group>

A Task containing the RPC response.

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

DeleteGroup(IResourceName, CallSettings)

public virtual void DeleteGroup(IResourceName name, CallSettings callSettings = null)

Deletes an existing group.

Parameters
NameDescription
nameIResourceName

Required. The group to delete. The format is:

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

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

DeleteGroup(DeleteGroupRequest, CallSettings)

public virtual void DeleteGroup(DeleteGroupRequest request, CallSettings callSettings = null)

Deletes an existing group.

Parameters
NameDescription
requestDeleteGroupRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
DeleteGroupRequest request = new DeleteGroupRequest
{
    GroupName = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
    Recursive = false,
};
// Make the request
groupServiceClient.DeleteGroup(request);

DeleteGroup(GroupName, CallSettings)

public virtual void DeleteGroup(GroupName name, CallSettings callSettings = null)

Deletes an existing group.

Parameters
NameDescription
nameGroupName

Required. The group to delete. The format is:

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
GroupName name = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]");
// Make the request
groupServiceClient.DeleteGroup(name);

DeleteGroup(String, CallSettings)

public virtual void DeleteGroup(string name, CallSettings callSettings = null)

Deletes an existing group.

Parameters
NameDescription
nameString

Required. The group to delete. The format is:

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
GroupServiceClient groupServiceClient = GroupServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/groups/[GROUP]";
// Make the request
groupServiceClient.DeleteGroup(name);

DeleteGroupAsync(IResourceName, CallSettings)

public virtual Task DeleteGroupAsync(IResourceName name, CallSettings callSettings = null)

Deletes an existing group.

Parameters
NameDescription
nameIResourceName

Required. The group to delete. The format is:

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

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");
// Make the request
await groupServiceClient.DeleteGroupAsync(name);

DeleteGroupAsync(IResourceName, CancellationToken)

public virtual Task DeleteGroupAsync(IResourceName name, CancellationToken cancellationToken)

Deletes an existing group.

Parameters
NameDescription
nameIResourceName

Required. The group to delete. The format is:

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

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");
// Make the request
await groupServiceClient.DeleteGroupAsync(name);

DeleteGroupAsync(DeleteGroupRequest, CallSettings)

public virtual Task DeleteGroupAsync(DeleteGroupRequest request, CallSettings callSettings = null)

Deletes an existing group.

Parameters
NameDescription
requestDeleteGroupRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteGroupRequest request = new DeleteGroupRequest
{
    GroupName = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
    Recursive = false,
};
// Make the request
await groupServiceClient.DeleteGroupAsync(request);

DeleteGroupAsync(DeleteGroupRequest, CancellationToken)

public virtual Task DeleteGroupAsync(DeleteGroupRequest request, CancellationToken cancellationToken)

Deletes an existing group.

Parameters
NameDescription
requestDeleteGroupRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteGroupRequest request = new DeleteGroupRequest
{
    GroupName = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
    Recursive = false,
};
// Make the request
await groupServiceClient.DeleteGroupAsync(request);

DeleteGroupAsync(GroupName, CallSettings)

public virtual Task DeleteGroupAsync(GroupName name, CallSettings callSettings = null)

Deletes an existing group.

Parameters
NameDescription
nameGroupName

Required. The group to delete. The format is:

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
GroupName name = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]");
// Make the request
await groupServiceClient.DeleteGroupAsync(name);

DeleteGroupAsync(GroupName, CancellationToken)

public virtual Task DeleteGroupAsync(GroupName name, CancellationToken cancellationToken)

Deletes an existing group.

Parameters
NameDescription
nameGroupName

Required. The group to delete. The format is:

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
GroupServiceClient groupServiceClient = await GroupServiceClient.CreateAsync();
// Initialize request argument(s)
GroupName name = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]");
// Make the request
await groupServiceClient.DeleteGroupAsync(name);

DeleteGroupAsync(String, CallSettings)

public virtual Task DeleteGroupAsync(string name, CallSettings callSettings = null)

Deletes an existing group.

Parameters
Name