rds#

class aws_resource_search.res.rds.RdsDbInstance(raw_data: 'T_RESULT_DATA', id: str, name: str, status: str, engine: str)[source]#
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_buckets api 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 title: str#

The title in the zelfred UI.

For example, you want to use the S3 bucket name as the title:

>>> @dataclasses.dataclass
... class S3BucketDocument(ResourceDocument):
...     @property
...     def title(self) -> str:
...         return f"bucket name = {self.name}"

Important

You have to implement this method for each AWS Resource Type.

property subtitle: str#

The subtitle in the zelfred UI.

See also

SUBTITLE

property autocomplete: str#

Autocomplete text for the zelfred UI.

property arn: str#

AWS Resource ARN, if applicable. User can tap ‘Ctrl + A’ to copy the ARN.

If the raw_data does not sufficient information to construct the ARN, you should declare a dataclasses.field() for it and initialize it in the from_resource() method. Then you can just reference it here.

Important

You have to implement this method for each AWS Resource Type.

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]#

Call boto3 API to get additional details for this resource. The detailed information will be rendered in the dropdown menu. It allows user to tap ‘Ctrl + P’ to enter a sub-session to view the details. User can tap ‘F1’ to go back to the previous session.

Important

You have to implement this method for each AWS Resource Type.

Note

Here’s some tips to implement this method correctly:

  1. For immutable attributes, such as resource id, name, you can

    extract them from the raw_data. For example, the Ec2 instance id.

  2. For mutable attributes, such as tags, you have to call boto3 API,

    because the raw_data is from the index and could be outdated.

  3. Use enrich_details() context manager when you

    need to call boto3 API. Because it may fail due to permission issue, or resource not exists issue.

class aws_resource_search.res.rds.RdsDbInstanceSearcher(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]#
class aws_resource_search.res.rds.RdsDbCluster(raw_data: 'T_RESULT_DATA', id: str, name: str, status: str, engine: str)[source]#
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_buckets api 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 title: str#

The title in the zelfred UI.

For example, you want to use the S3 bucket name as the title:

>>> @dataclasses.dataclass
... class S3BucketDocument(ResourceDocument):
...     @property
...     def title(self) -> str:
...         return f"bucket name = {self.name}"

Important

You have to implement this method for each AWS Resource Type.

property subtitle: str#

The subtitle in the zelfred UI.

See also

SUBTITLE

property autocomplete: str#

Autocomplete text for the zelfred UI.

property arn: str#

AWS Resource ARN, if applicable. User can tap ‘Ctrl + A’ to copy the ARN.

If the raw_data does not sufficient information to construct the ARN, you should declare a dataclasses.field() for it and initialize it in the from_resource() method. Then you can just reference it here.

Important

You have to implement this method for each AWS Resource Type.

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]#

Call boto3 API to get additional details for this resource. The detailed information will be rendered in the dropdown menu. It allows user to tap ‘Ctrl + P’ to enter a sub-session to view the details. User can tap ‘F1’ to go back to the previous session.

Important

You have to implement this method for each AWS Resource Type.

Note

Here’s some tips to implement this method correctly:

  1. For immutable attributes, such as resource id, name, you can

    extract them from the raw_data. For example, the Ec2 instance id.

  2. For mutable attributes, such as tags, you have to call boto3 API,

    because the raw_data is from the index and could be outdated.

  3. Use enrich_details() context manager when you

    need to call boto3 API. Because it may fail due to permission issue, or resource not exists issue.

class aws_resource_search.res.rds.RdsDbClusterSearcher(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]#