Struct aws_sdk_resourcegroups::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
Client for AWS Resource Groups
Client for invoking operations on AWS Resource Groups. Each operation on AWS Resource Groups is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_resourcegroups::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_resourcegroups::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_resourcegroups::Client::from_conf(config);
Implementations
sourceimpl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
sourceimpl Client
impl Client
sourcepub fn create_group(&self) -> CreateGroup
pub fn create_group(&self) -> CreateGroup
Constructs a fluent builder for the CreateGroup
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the group, which is the identifier of the group in other operations. You can’t change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with
AWS
oraws
; these are reserved. A resource group name must be unique within each AWS Region in your AWS account.description(impl Into<String>)
/set_description(Option<String>)
:The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.
resource_query(ResourceQuery)
/set_resource_query(Option<ResourceQuery>)
:The resource query that determines which AWS resources are members of this group. For more information about resource queries, see Create a tag-based group in Resource Groups.
A resource group can contain either a
ResourceQuery
or aConfiguration
, but not both.tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
:The tags to add to the group. A tag is key-value pair string.
configuration(Vec<GroupConfigurationItem>)
/set_configuration(Option<Vec<GroupConfigurationItem>>)
:A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of
GroupConfigurationItem
elements. For details about the syntax of service configurations, see Service configurations for resource groups.A resource group can contain either a
Configuration
or aResourceQuery
, but not both.
- On success, responds with
CreateGroupOutput
with field(s):group(Option<Group>)
:The description of the resource group.
resource_query(Option<ResourceQuery>)
:The resource query associated with the group. For more information about resource queries, see Create a tag-based group in Resource Groups.
tags(Option<HashMap<String, String>>)
:The tags associated with the group.
group_configuration(Option<GroupConfiguration>)
:The service configuration associated with the resource group. For details about the syntax of a service configuration, see Service configurations for resource groups.
- On failure, responds with
SdkError<CreateGroupError>
sourcepub fn delete_group(&self) -> DeleteGroup
pub fn delete_group(&self) -> DeleteGroup
Constructs a fluent builder for the DeleteGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:Deprecated - don’t use this parameter. Use
Group
instead.group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group to delete.
- On success, responds with
DeleteGroupOutput
with field(s):group(Option<Group>)
:A full description of the deleted resource group.
- On failure, responds with
SdkError<DeleteGroupError>
sourcepub fn get_group(&self) -> GetGroup
pub fn get_group(&self) -> GetGroup
Constructs a fluent builder for the GetGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:Deprecated - don’t use this parameter. Use
Group
instead.group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group to retrieve.
- On success, responds with
GetGroupOutput
with field(s):group(Option<Group>)
:A full description of the resource group.
- On failure, responds with
SdkError<GetGroupError>
sourcepub fn get_group_configuration(&self) -> GetGroupConfiguration
pub fn get_group_configuration(&self) -> GetGroupConfiguration
Constructs a fluent builder for the GetGroupConfiguration
operation.
- The fluent builder is configurable:
group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group.
- On success, responds with
GetGroupConfigurationOutput
with field(s):group_configuration(Option<GroupConfiguration>)
:The service configuration associated with the specified group. For details about the service configuration syntax, see Service configurations for resource groups.
- On failure, responds with
SdkError<GetGroupConfigurationError>
sourcepub fn get_group_query(&self) -> GetGroupQuery
pub fn get_group_query(&self) -> GetGroupQuery
Constructs a fluent builder for the GetGroupQuery
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:Don’t use this parameter. Use
Group
instead.group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group to query.
- On success, responds with
GetGroupQueryOutput
with field(s):group_query(Option<GroupQuery>)
:The resource query associated with the specified group. For more information about resource queries, see Create a tag-based group in Resource Groups.
- On failure, responds with
SdkError<GetGroupQueryError>
Constructs a fluent builder for the GetTags
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:The ARN of the resource group whose tags you want to retrieve.
- On success, responds with
GetTagsOutput
with field(s):arn(Option<String>)
:The ARN of the tagged resource group.
tags(Option<HashMap<String, String>>)
:The tags associated with the specified resource group.
- On failure, responds with
SdkError<GetTagsError>
sourcepub fn group_resources(&self) -> GroupResources
pub fn group_resources(&self) -> GroupResources
Constructs a fluent builder for the GroupResources
operation.
- The fluent builder is configurable:
group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group to add resources to.
resource_arns(Vec<String>)
/set_resource_arns(Option<Vec<String>>)
:The list of ARNs for resources to be added to the group.
- On success, responds with
GroupResourcesOutput
with field(s):succeeded(Option<Vec<String>>)
:A list of ARNs of resources that were successfully added to the group by this operation.
failed(Option<Vec<FailedResource>>)
:A list of ARNs of any resources that failed to be added to the group by this operation.
pending(Option<Vec<PendingResource>>)
:A list of ARNs of any resources that are still in the process of being added to the group by this operation. These pending additions continue asynchronously. You can check the status of pending additions by using the
ListGroupResources
Resources
array in the response and theStatus
field of each object in that array.
- On failure, responds with
SdkError<GroupResourcesError>
sourcepub fn list_group_resources(&self) -> ListGroupResources
pub fn list_group_resources(&self) -> ListGroupResources
Constructs a fluent builder for the ListGroupResources
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:Deprecated - don’t use this parameter. Use the
Group
request field instead.group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group
filters(Vec<ResourceFilter>)
/set_filters(Option<Vec<ResourceFilter>>)
:Filters, formatted as
ResourceFilter
objects, that you want to apply to aListGroupResources
operation. Filters the results to include only those of the specified resource types.-
resource-type
- Filter resources by their type. Specify up to five resource types in the formatAWS::ServiceCode::ResourceType
. For example,AWS::EC2::Instance
, orAWS::S3::Bucket
.
When you specify a
resource-type
filter forListGroupResources
, AWS Resource Groups validates your filter resource types against the types that are defined in the query associated with the group. For example, if a group contains only S3 buckets because its query specifies only that resource type, but yourresource-type
filter includes EC2 instances, AWS Resource Groups does not filter for EC2 instances. In this case, aListGroupResources
request returns aBadRequestException
error with a message similar to the following:The resource types specified as filters in the request are not valid.
The error includes a list of resource types that failed the validation because they are not part of the query associated with the group. This validation doesn’t occur when the group query specifies
AWS::AllSupported
, because a group based on such a query can contain any of the allowed resource types for the query type (tag-based or AWS CloudFormation stack-based queries).-
max_results(i32)
/set_max_results(Option<i32>)
:The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the
NextToken
response element is present and has a value (is not null). Include that value as theNextToken
request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should checkNextToken
after every operation to ensure that you receive all of the results.next_token(impl Into<String>)
/set_next_token(Option<String>)
:The parameter for receiving additional results if you receive a
NextToken
response in a previous request. ANextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call’sNextToken
response to indicate where the output should continue from.
- On success, responds with
ListGroupResourcesOutput
with field(s):resources(Option<Vec<ListGroupResourcesItem>>)
:An array of resources from which you can determine each resource’s identity, type, and group membership status.
resource_identifiers(Option<Vec<ResourceIdentifier>>)
:Deprecated - don’t use this parameter. Use the
Resources
response field instead.next_token(Option<String>)
:If present, indicates that more output is available than is included in the current response. Use this value in the
NextToken
request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until theNextToken
response element comes back asnull
.query_errors(Option<Vec<QueryError>>)
:A list of
QueryError
objects. Each error is an object that containsErrorCode
andMessage
structures. Possible values forErrorCode
areCLOUDFORMATION_STACK_INACTIVE
andCLOUDFORMATION_STACK_NOT_EXISTING
.
- On failure, responds with
SdkError<ListGroupResourcesError>
sourcepub fn list_groups(&self) -> ListGroups
pub fn list_groups(&self) -> ListGroups
Constructs a fluent builder for the ListGroups
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
filters(Vec<GroupFilter>)
/set_filters(Option<Vec<GroupFilter>>)
:Filters, formatted as
GroupFilter
objects, that you want to apply to aListGroups
operation.-
resource-type
- Filter the results to include only those of the specified resource types. Specify up to five resource types in the formatAWS::ServiceCode::ResourceType
. For example,AWS::EC2::Instance
, orAWS::S3::Bucket
. -
configuration-type
- Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:-
AWS:EC2::CapacityReservationPool
-
AWS:EC2::HostManagement
-
-
max_results(i32)
/set_max_results(Option<i32>)
:The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the
NextToken
response element is present and has a value (is not null). Include that value as theNextToken
request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should checkNextToken
after every operation to ensure that you receive all of the results.next_token(impl Into<String>)
/set_next_token(Option<String>)
:The parameter for receiving additional results if you receive a
NextToken
response in a previous request. ANextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call’sNextToken
response to indicate where the output should continue from.
- On success, responds with
ListGroupsOutput
with field(s):group_identifiers(Option<Vec<GroupIdentifier>>)
:A list of
GroupIdentifier
objects. Each identifier is an object that contains both theName
and theGroupArn
.groups(Option<Vec<Group>>)
:Deprecated - don’t use this field. Use the
GroupIdentifiers
response field instead.next_token(Option<String>)
:If present, indicates that more output is available than is included in the current response. Use this value in the
NextToken
request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until theNextToken
response element comes back asnull
.
- On failure, responds with
SdkError<ListGroupsError>
sourcepub fn put_group_configuration(&self) -> PutGroupConfiguration
pub fn put_group_configuration(&self) -> PutGroupConfiguration
Constructs a fluent builder for the PutGroupConfiguration
operation.
- The fluent builder is configurable:
group(impl Into<String>)
/set_group(Option<String>)
:The name or ARN of the resource group with the configuration that you want to update.
configuration(Vec<GroupConfigurationItem>)
/set_configuration(Option<Vec<GroupConfigurationItem>>)
:The new configuration to associate with the specified group. A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of
GroupConfigurationItem
elements.For information about the syntax of a service configuration, see Service configurations for resource groups.
A resource group can contain either a
Configuration
or aResourceQuery
, but not both.
- On success, responds with
PutGroupConfigurationOutput
- On failure, responds with
SdkError<PutGroupConfigurationError>
sourcepub fn search_resources(&self) -> SearchResources
pub fn search_resources(&self) -> SearchResources
Constructs a fluent builder for the SearchResources
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
resource_query(ResourceQuery)
/set_resource_query(Option<ResourceQuery>)
:The search query, using the same formats that are supported for resource group definition. For more information, see
CreateGroup
.max_results(i32)
/set_max_results(Option<i32>)
:The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the
NextToken
response element is present and has a value (is not null). Include that value as theNextToken
request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should checkNextToken
after every operation to ensure that you receive all of the results.next_token(impl Into<String>)
/set_next_token(Option<String>)
:The parameter for receiving additional results if you receive a
NextToken
response in a previous request. ANextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call’sNextToken
response to indicate where the output should continue from.
- On success, responds with
SearchResourcesOutput
with field(s):resource_identifiers(Option<Vec<ResourceIdentifier>>)
:The ARNs and resource types of resources that are members of the group that you specified.
next_token(Option<String>)
:If present, indicates that more output is available than is included in the current response. Use this value in the
NextToken
request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until theNextToken
response element comes back asnull
.query_errors(Option<Vec<QueryError>>)
:A list of
QueryError
objects. Each error is an object that containsErrorCode
andMessage
structures. Possible values forErrorCode
areCLOUDFORMATION_STACK_INACTIVE
andCLOUDFORMATION_STACK_NOT_EXISTING
.
- On failure, responds with
SdkError<SearchResourcesError>
sourcepub fn tag(&self) -> Tag
pub fn tag(&self) -> Tag
Constructs a fluent builder for the Tag
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:The ARN of the resource group to which to add tags.
tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
:The tags to add to the specified resource group. A tag is a string-to-string map of key-value pairs.
- On success, responds with
TagOutput
with field(s):arn(Option<String>)
:The ARN of the tagged resource.
tags(Option<HashMap<String, String>>)
:The tags that have been added to the specified resource group.
- On failure, responds with
SdkError<TagError>
sourcepub fn ungroup_resources(&self) -> UngroupResources
pub fn ungroup_resources(&self) -> UngroupResources
Constructs a fluent builder for the UngroupResources
operation.
- The fluent builder is configurable:
group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group from which to remove the resources.
resource_arns(Vec<String>)
/set_resource_arns(Option<Vec<String>>)
:The ARNs of the resources to be removed from the group.
- On success, responds with
UngroupResourcesOutput
with field(s):succeeded(Option<Vec<String>>)
:A list of resources that were successfully removed from the group by this operation.
failed(Option<Vec<FailedResource>>)
:A list of any resources that failed to be removed from the group by this operation.
pending(Option<Vec<PendingResource>>)
:A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the
ListGroupResources
- On failure, responds with
SdkError<UngroupResourcesError>
sourcepub fn untag(&self) -> Untag
pub fn untag(&self) -> Untag
Constructs a fluent builder for the Untag
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:The ARN of the resource group from which to remove tags. The command removed both the specified keys and any values associated with those keys.
keys(Vec<String>)
/set_keys(Option<Vec<String>>)
:The keys of the tags to be removed.
- On success, responds with
UntagOutput
with field(s):arn(Option<String>)
:The ARN of the resource group from which tags have been removed.
keys(Option<Vec<String>>)
:The keys of the tags that were removed.
- On failure, responds with
SdkError<UntagError>
sourcepub fn update_group(&self) -> UpdateGroup
pub fn update_group(&self) -> UpdateGroup
Constructs a fluent builder for the UpdateGroup
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:Don’t use this parameter. Use
Group
instead.group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group to modify.
description(impl Into<String>)
/set_description(Option<String>)
:The new description that you want to update the resource group with. Descriptions can contain letters, numbers, hyphens, underscores, periods, and spaces.
- On success, responds with
UpdateGroupOutput
with field(s):group(Option<Group>)
:The update description of the resource group.
- On failure, responds with
SdkError<UpdateGroupError>
sourcepub fn update_group_query(&self) -> UpdateGroupQuery
pub fn update_group_query(&self) -> UpdateGroupQuery
Constructs a fluent builder for the UpdateGroupQuery
operation.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:Don’t use this parameter. Use
Group
instead.group(impl Into<String>)
/set_group(Option<String>)
:The name or the ARN of the resource group to query.
resource_query(ResourceQuery)
/set_resource_query(Option<ResourceQuery>)
:The resource query to determine which AWS resources are members of this resource group.
A resource group can contain either a
Configuration
or aResourceQuery
, but not both.
- On success, responds with
UpdateGroupQueryOutput
with field(s):group_query(Option<GroupQuery>)
:The updated resource query associated with the resource group after the update.
- On failure, responds with
SdkError<UpdateGroupQueryError>
sourceimpl Client
impl Client
sourcepub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
pub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
Creates a client with the given service config and connector override.
Trait Implementations
sourceimpl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
impl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
sourcefn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
fn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more