blib/lib/Paws/ResourceGroups/ResourceQuery.pm untested

filter: Statementstmt 0.0% 0 / 5 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod n/a totaltotal 0.0% 0 / 6 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
CRAP 2.0
1 # Generated by default/object.tt
2 package Paws::ResourceGroups::ResourceQuery;
3 use Moose;
4 has Query => (is => 'ro', isa => 'Str', required => 1);
5 has Type => (is => 'ro', isa => 'Str', required => 1);
6  
7 1;
8  
9 ### main pod documentation begin ###
10  
11 =head1 NAME
12  
13 Paws::ResourceGroups::ResourceQuery
14  
15 =head1 USAGE
16  
17 This class represents one of two things:
18  
19 =head3 Arguments in a call to a service
20  
21 Use the attributes of this class as arguments to methods. You shouldn't make instances of this class.
22 Each attribute should be used as a named argument in the calls that expect this type of object.
23  
24 As an example, if Att1 is expected to be a Paws::ResourceGroups::ResourceQuery object:
25  
26 $service_obj->Method(Att1 => { Query => $value, ..., Type => $value });
27  
28 =head3 Results returned from an API call
29  
30 Use accessors for each attribute. If Att1 is expected to be an Paws::ResourceGroups::ResourceQuery object:
31  
32 $result = $service_obj->Method(...);
33 $result->Att1->Query
34  
35 =head1 DESCRIPTION
36  
37 The query that is used to define a resource group or a search for
38 resources. A query specifies both a query type and a query string as a
39 JSON object. See the examples section for example JSON strings.
40  
41 The examples that follow are shown as standard JSON strings. If you
42 include such a string as a parameter to the AWS CLI or an SDK API, you
43 might need to 'escape' the string into a single line. For example, see
44 the Quoting strings
45 (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-quoting-strings.html)
46 in the I<AWS CLI User Guide>.
47  
48 B<Example 1>
49  
50 The following generic example shows a resource query JSON string that
51 includes only resources that meet the following criteria:
52  
53 =over
54  
55 =item *
56  
57 The resource type must be either C<resource_type1> or
58 C<resource_type2>.
59  
60 =item *
61  
62 The resource must have a tag C<Key1> with a value of either C<ValueA>
63 or C<ValueB>.
64  
65 =item *
66  
67 The resource must have a tag C<Key2> with a value of either C<ValueC>
68 or C<ValueD>.
69  
70 =back
71  
72 C<{ "Type": "TAG_FILTERS_1_0", "Query": { "ResourceTypeFilters": [
73 "resource_type1", "resource_type2"], "TagFilters": [ { "Key": "Key1",
74 "Values": ["ValueA","ValueB"] }, { "Key":"Key2",
75 "Values":["ValueC","ValueD"] } ] } }>
76  
77 This has the equivalent "shortcut" syntax of the following:
78  
79 C<{ "Type": "TAG_FILTERS_1_0", "Query": { "ResourceTypeFilters": [
80 "resource_type1", "resource_type2"], "TagFilters": [ { "Key1":
81 ["ValueA","ValueB"] }, { "Key2": ["ValueC","ValueD"] } ] } }>
82  
83 B<Example 2>
84  
85 The following example shows a resource query JSON string that includes
86 only Amazon EC2 instances that are tagged C<Stage> with a value of
87 C<Test>.
88  
89 C<{ "Type": "TAG_FILTERS_1_0", "Query": "{ "ResourceTypeFilters":
90 "AWS::EC2::Instance", "TagFilters": { "Stage": "Test" } } }>
91  
92 B<Example 3>
93  
94 The following example shows a resource query JSON string that includes
95 resource of any supported type as long as it is tagged C<Stage> with a
96 value of C<Prod>.
97  
98 C<{ "Type": "TAG_FILTERS_1_0", "Query": { "ResourceTypeFilters":
99 "AWS::AllSupported", "TagFilters": { "Stage": "Prod" } } }>
100  
101 B<Example 4>
102  
103 The following example shows a resource query JSON string that includes
104 only Amazon EC2 instances and Amazon S3 buckets that are part of the
105 specified AWS CloudFormation stack.
106  
107 C<{ "Type": "CLOUDFORMATION_STACK_1_0", "Query": {
108 "ResourceTypeFilters": [ "AWS::EC2::Instance", "AWS::S3::Bucket" ],
109 "StackIdentifier":
110 "arn:aws:cloudformation:us-west-2:123456789012:stack/AWStestuseraccount/fb0d5000-aba8-00e8-aa9e-50d5cEXAMPLE"
111 } }>
112  
113 =head1 ATTRIBUTES
114  
115  
116 =head2 B<REQUIRED> Query => Str
117  
118 The query that defines a group or a search.
119  
120  
121 =head2 B<REQUIRED> Type => Str
122  
123 The type of the query. You can use the following values:
124  
125 =over
126  
127 =item *
128  
129 I<C<CLOUDFORMATION_STACK_1_0:> >Specifies that the C<Query> contains an
130 ARN for a CloudFormation stack.
131  
132 =item *
133  
134 I<C<TAG_FILTERS_1_0:> >Specifies that the C<Query> parameter contains a
135 JSON string that represents a collection of simple tag filters for
136 resource types and tags. The JSON string uses a syntax similar to the
137 C< GetResources
138 (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html)
139 > operation, but uses only the C< ResourceTypeFilters
140 (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html#resourcegrouptagging-GetResources-request-ResourceTypeFilters)
141 > and C< TagFilters
142 (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html#resourcegrouptagging-GetResources-request-TagFiltersTagFilters)
143 > fields. If you specify more than one tag key, only resources that
144 match all tag keys, and at least one value of each specified tag key,
145 are returned in your query. If you specify more than one value for a
146 tag key, a resource matches the filter if it has a tag key value that
147 matches I<any> of the specified values.
148  
149 For example, consider the following sample query for resources that
150 have two tags, C<Stage> and C<Version>, with two values each:
151  
152 C<[{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]>
153  
154 The results of this query could include the following.
155  
156 =over
157  
158 =item *
159  
160 An EC2 instance that has the following two tags: C<{"Stage":"Deploy"}>,
161 and C<{"Version":"2"}>
162  
163 =item *
164  
165 An S3 bucket that has the following two tags: C<{"Stage":"Test"}>, and
166 C<{"Version":"1"}>
167  
168 =back
169  
170 The query would not include the following items in the results,
171 however.
172  
173 =over
174  
175 =item *
176  
177 An EC2 instance that has only the following tag: C<{"Stage":"Deploy"}>.
178  
179 The instance does not have B<all> of the tag keys specified in the
180 filter, so it is excluded from the results.
181  
182 =item *
183  
184 An RDS database that has the following two tags:
185 C<{"Stage":"Archived"}> and C<{"Version":"4"}>
186  
187 The database has all of the tag keys, but none of those keys has an
188 associated value that matches at least one of the specified values in
189 the filter.
190  
191 =back
192  
193 =back
194  
195  
196  
197  
198 =head1 SEE ALSO
199  
200 This class forms part of L<Paws>, describing an object used in L<Paws::ResourceGroups>
201  
202 =head1 BUGS and CONTRIBUTIONS
203  
204 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
205  
206 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
207  
208 =cut
209