s3#
S3 related resources.
This module is an example of how to enable aws_resource_search to support new resource types.
- class aws_resource_search.res.s3.S3Bucket(raw_data: T_RESULT_DATA, id: str, name: str)[source]#
S3 Bucket resource data model.
- classmethod from_resource(resource, bsm, boto_kwargs)[source]#
Create a document object from the boto3 API response data. Since the API response data relies on both the โbsmโ object and โboto_kwargs,โ we also require this information to create the document object.
For example,
s3_client.list_bucketsapi returns:{ 'Name': '...', 'CreationDate': datetime.datetime(...) }
Then, the implementation should be:
>>> @dataclasses.dataclass ... class S3BucketDocument(ResourceDocument): ... @classmethod ... def from_resource( ... cls, ... resource: "T_RESULT_DATA", ... bsm: "BotoSesManager", ... boto_kwargs: dict, ... ): ... return cls( ... raw_data=resource, ... id=resource["Name"], ... name=resource["Name"], ... )
Note
You have to implement this method for each AWS Resource Type.
- property subtitle: str#
Example: create_at = 2021-07-06T15:04:40+00:00, ๐ Enter, ๐ Ctrl A, ๐ Ctrl U, ๐ Ctrl P.
- get_console_url(console: AWSConsole) str[source]#
AWS Console URL to view this AWS resource in the console. If applicable, User can tap โEnterโ to open in browser.
Important
You have to implement this method for each AWS Resource Type.
- classmethod get_list_resources_console_url(console: AWSConsole) str[source]#
AWS Console URL to view list all AWS resources of this type in the console. If applicable, User can tap โEnterโ to open in browser.
Important
You have to implement this method for each AWS Resource Type.
- get_details(ars: ARS) List[DetailItem][source]#
Include s3 uri, s3 arn, bucket location and tags in details.
- class aws_resource_search.res.s3.S3BucketSearcher(service: str, method: str, is_paginator: bool, default_boto_kwargs: Optional[dict], result_path: ResultPath, doc_class: Type[T_ARS_RESOURCE_DOCUMENT], resource_type: str, fields: List[Union[StoredField, IdField, IdListField, KeywordField, TextField, NumericField, DatetimeField, BooleanField, NgramField, NgramWordsField]], cache_expire: int, more_cache_key: Optional[Callable[[Dict[str, Any]], List[str]]], bsm: Optional[BotoSesManager] = None)[source]#