create_view
(**kwargs)¶Creates a view that users can query by using the Search operation. Results from queries that you make using this view include only resources that match the view's Filters
. For more information about Amazon Web Services Resource Explorer views, see Managing views in the Amazon Web Services Resource Explorer User Guide .
Only the principals with an IAM identity-based policy that grants Allow
to the Search
action on a Resource
with the Amazon resource name (ARN) of this view can Search using views you create with this operation.
See also: AWS API Documentation
Request Syntax
response = client.create_view(
ClientToken='string',
Filters={
'FilterString': 'string'
},
IncludedProperties=[
{
'Name': 'string'
},
],
Tags={
'string': 'string'
},
ViewName='string'
)
This value helps ensure idempotency. Resource Explorer uses this value to prevent the accidental creation of duplicate versions. We recommend that you generate a UUID-type value to ensure the uniqueness of your views.
This field is autopopulated if not provided.
An array of strings that specify which resources are included in the results of queries made using this view. When you use this view in a Search operation, the filter string is combined with the search's QueryString
parameter using a logical AND
operator.
For information about the supported syntax, see Search query reference for Resource Explorer in the Amazon Web Services Resource Explorer User Guide .
Warning
This query string in the context of this operation supports only filter prefixes with optional operators. It doesn't support free-form text. For example, the string region:us* service:ec2 -tag:stage=prod
includes all Amazon EC2 resources in any Amazon Web Services Region that begins with the letters us
and is not tagged with a key Stage
that has the value prod
.
The string that contains the search keywords, prefixes, and operators to control the results that can be returned by a Search operation. For more details, see Search query syntax.
Specifies optional fields that you want included in search results from this view. It is a list of objects that each describe a field to include.
The default is an empty list, with no optional fields included in the results.
Information about an additional property that describes a resource, that you can optionally include in the view. This lets you view that property in search results, and filter your search results based on the value of the property.
The name of the property that is included in this view.
You can specify the following property names for this field:
Tags
Tag key and value pairs that are attached to the view.
[REQUIRED]
The name of the new view. This name appears in the list of views in Resource Explorer.
The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its Amazon Web Services Region.
dict
Response Syntax
{
'View': {
'Filters': {
'FilterString': 'string'
},
'IncludedProperties': [
{
'Name': 'string'
},
],
'LastUpdatedAt': datetime(2015, 1, 1),
'Owner': 'string',
'Scope': 'string',
'ViewArn': 'string'
}
}
Response Structure
(dict) --
View (dict) --
A structure that contains the details about the new view.
Filters (dict) --
An array of SearchFilter objects that specify which resources can be included in the results of queries made using this view.
FilterString (string) --
The string that contains the search keywords, prefixes, and operators to control the results that can be returned by a Search operation. For more details, see Search query syntax.
IncludedProperties (list) --
A structure that contains additional information about the view.
(dict) --
Information about an additional property that describes a resource, that you can optionally include in the view. This lets you view that property in search results, and filter your search results based on the value of the property.
Name (string) --
The name of the property that is included in this view.
You can specify the following property names for this field:
Tags
LastUpdatedAt (datetime) --
The date and time when this view was last modified.
Owner (string) --
The Amazon Web Services account that owns this view.
Scope (string) --
An Amazon resource name (ARN) of an Amazon Web Services account, an organization, or an organizational unit (OU) that specifies whether this view includes resources from only the specified Amazon Web Services account, all accounts in the specified organization, or all accounts in the specified OU.
If not specified, the value defaults to the Amazon Web Services account used to call this operation.
ViewArn (string) --
The Amazon resource name (ARN) of the view.
Exceptions
ResourceExplorer.Client.exceptions.InternalServerException
ResourceExplorer.Client.exceptions.ValidationException
ResourceExplorer.Client.exceptions.ConflictException
ResourceExplorer.Client.exceptions.ServiceQuotaExceededException
ResourceExplorer.Client.exceptions.UnauthorizedException
ResourceExplorer.Client.exceptions.ThrottlingException
ResourceExplorer.Client.exceptions.AccessDeniedException