You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::ResourceGroups::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



153
154
155
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 153

def initialize(*args)
  super
end

Instance Method Details

#create_group(params = {}) ⇒ Types::CreateGroupOutput

Creates a group with a specified name, description, and resource query.

Examples:

Request syntax with placeholder values


resp = client.create_group({
  name: "GroupName", # required
  description: "GroupDescription",
  resource_query: { # required
    type: "TAG_FILTERS_1_0", # required, accepts TAG_FILTERS_1_0
    query: "Query", # required
  },
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.group.group_arn #=> String
resp.group.name #=> String
resp.group.description #=> String
resp.resource_query.type #=> String, one of "TAG_FILTERS_1_0"
resp.resource_query.query #=> String
resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the group, which is the identifier of the group in other operations. A resource group name cannot be updated after it is created. A resource group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws; these are reserved. A resource group name must be unique within your account.

  • :description (String)

    The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.

  • :resource_query (required, Types::ResourceQuery)

    The resource query that determines which AWS resources are members of this group.

  • :tags (Hash<String,String>)

    The tags to add to the group. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 127 characters, and tag values can have a maximum length of 255 characters.

Returns:

See Also:



219
220
221
222
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 219

def create_group(params = {}, options = {})
  req = build_request(:create_group, params)
  req.send_request(options)
end

#delete_group(params = {}) ⇒ Types::DeleteGroupOutput

Deletes a specified resource group. Deleting a resource group does not delete resources that are members of the group; it only deletes the group structure.

Examples:

Request syntax with placeholder values


resp = client.delete_group({
  group_name: "GroupName", # required
})

Response structure


resp.group.group_arn #=> String
resp.group.name #=> String
resp.group.description #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the resource group to delete.

Returns:

See Also:



251
252
253
254
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 251

def delete_group(params = {}, options = {})
  req = build_request(:delete_group, params)
  req.send_request(options)
end

#get_group(params = {}) ⇒ Types::GetGroupOutput

Returns information about a specified resource group.

Examples:

Request syntax with placeholder values


resp = client.get_group({
  group_name: "GroupName", # required
})

Response structure


resp.group.group_arn #=> String
resp.group.name #=> String
resp.group.description #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the resource group.

Returns:

See Also:



281
282
283
284
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 281

def get_group(params = {}, options = {})
  req = build_request(:get_group, params)
  req.send_request(options)
end

#get_group_query(params = {}) ⇒ Types::GetGroupQueryOutput

Returns the resource query associated with the specified resource group.

Examples:

Request syntax with placeholder values


resp = client.get_group_query({
  group_name: "GroupName", # required
})

Response structure


resp.group_query.group_name #=> String
resp.group_query.resource_query.type #=> String, one of "TAG_FILTERS_1_0"
resp.group_query.resource_query.query #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the resource group.

Returns:

See Also:



312
313
314
315
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 312

def get_group_query(params = {}, options = {})
  req = build_request(:get_group_query, params)
  req.send_request(options)
end

#get_tags(params = {}) ⇒ Types::GetTagsOutput

Returns a list of tags that are associated with a resource, specified by an ARN.

Examples:

Request syntax with placeholder values


resp = client.get_tags({
  arn: "GroupArn", # required
})

Response structure


resp.arn #=> String
resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :arn (required, String)

    The ARN of the resource for which you want a list of tags. The resource must exist within the account you are using.

Returns:

See Also:



345
346
347
348
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 345

def get_tags(params = {}, options = {})
  req = build_request(:get_tags, params)
  req.send_request(options)
end

#list_group_resources(params = {}) ⇒ Types::ListGroupResourcesOutput

Returns a list of ARNs of resources that are members of a specified resource group.

Examples:

Request syntax with placeholder values


resp = client.list_group_resources({
  group_name: "GroupName", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.resource_identifiers #=> Array
resp.resource_identifiers[0].resource_arn #=> String
resp.resource_identifiers[0].resource_type #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the resource group.

  • :max_results (Integer)

    The maximum number of group member ARNs that are returned in a single call by ListGroupResources, in paginated output. By default, this number is 50.

  • :next_token (String)

    The NextToken value that is returned in a paginated ListGroupResources request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.

Returns:

See Also:



390
391
392
393
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 390

def list_group_resources(params = {}, options = {})
  req = build_request(:list_group_resources, params)
  req.send_request(options)
end

#list_groups(params = {}) ⇒ Types::ListGroupsOutput

Returns a list of existing resource groups in your account.

Examples:

Request syntax with placeholder values


resp = client.list_groups({
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.groups #=> Array
resp.groups[0].group_arn #=> String
resp.groups[0].name #=> String
resp.groups[0].description #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :max_results (Integer)

    The maximum number of resource group results that are returned by ListGroups in paginated output. By default, this number is 50.

  • :next_token (String)

    The NextToken value that is returned in a paginated ListGroups request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.

Returns:

See Also:



430
431
432
433
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 430

def list_groups(params = {}, options = {})
  req = build_request(:list_groups, params)
  req.send_request(options)
end

#search_resources(params = {}) ⇒ Types::SearchResourcesOutput

Returns a list of AWS resource identifiers that matches a specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.

Examples:

Request syntax with placeholder values


resp = client.search_resources({
  resource_query: { # required
    type: "TAG_FILTERS_1_0", # required, accepts TAG_FILTERS_1_0
    query: "Query", # required
  },
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.resource_identifiers #=> Array
resp.resource_identifiers[0].resource_arn #=> String
resp.resource_identifiers[0].resource_type #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_query (required, Types::ResourceQuery)

    The search query, using the same formats that are supported for resource group definition.

  • :max_results (Integer)

    The maximum number of group member ARNs returned by SearchResources in paginated output. By default, this number is 50.

  • :next_token (String)

    The NextToken value that is returned in a paginated SearchResources request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.

Returns:

See Also:



479
480
481
482
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 479

def search_resources(params = {}, options = {})
  req = build_request(:search_resources, params)
  req.send_request(options)
end

#tag(params = {}) ⇒ Types::TagOutput

Adds specified tags to a resource with the specified ARN. Existing tags on a resource are not changed if they are not specified in the request parameters.

Examples:

Request syntax with placeholder values


resp = client.tag({
  arn: "GroupArn", # required
  tags: { # required
    "TagKey" => "TagValue",
  },
})

Response structure


resp.arn #=> String
resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :arn (required, String)

    The ARN of the resource to which to add tags.

  • :tags (required, Hash<String,String>)

    The tags to add to the specified resource. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 127 characters, and tag values can have a maximum length of 255 characters.

Returns:

See Also:



521
522
523
524
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 521

def tag(params = {}, options = {})
  req = build_request(:tag, params)
  req.send_request(options)
end

#untag(params = {}) ⇒ Types::UntagOutput

Deletes specified tags from a specified resource.

Examples:

Request syntax with placeholder values


resp = client.untag({
  arn: "GroupArn", # required
  keys: ["TagKey"], # required
})

Response structure


resp.arn #=> String
resp.keys #=> Array
resp.keys[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :arn (required, String)

    The ARN of the resource from which to remove tags.

  • :keys (required, Array<String>)

    The keys of the tags to be removed.

Returns:

See Also:



556
557
558
559
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 556

def untag(params = {}, options = {})
  req = build_request(:untag, params)
  req.send_request(options)
end

#update_group(params = {}) ⇒ Types::UpdateGroupOutput

Updates an existing group with a new or changed description. You cannot update the name of a resource group.

Examples:

Request syntax with placeholder values


resp = client.update_group({
  group_name: "GroupName", # required
  description: "GroupDescription",
})

Response structure


resp.group.group_arn #=> String
resp.group.name #=> String
resp.group.description #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the resource group for which you want to update its description.

  • :description (String)

    The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.

Returns:

See Also:



594
595
596
597
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 594

def update_group(params = {}, options = {})
  req = build_request(:update_group, params)
  req.send_request(options)
end

#update_group_query(params = {}) ⇒ Types::UpdateGroupQueryOutput

Updates the resource query of a group.

Examples:

Request syntax with placeholder values


resp = client.update_group_query({
  group_name: "GroupName", # required
  resource_query: { # required
    type: "TAG_FILTERS_1_0", # required, accepts TAG_FILTERS_1_0
    query: "Query", # required
  },
})

Response structure


resp.group_query.group_name #=> String
resp.group_query.resource_query.type #=> String, one of "TAG_FILTERS_1_0"
resp.group_query.resource_query.query #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :group_name (required, String)

    The name of the resource group for which you want to edit the query.

  • :resource_query (required, Types::ResourceQuery)

    The resource query that determines which AWS resources are members of the resource group.

Returns:

See Also:



632
633
634
635
# File 'gems/aws-sdk-resourcegroups/lib/aws-sdk-resourcegroups/client.rb', line 632

def update_group_query(params = {}, options = {})
  req = build_request(:update_group_query, params)
  req.send_request(options)
end