├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── MANIFEST.in
├── README.md
├── docs
├── setup.md
└── supported_services.md
├── imgs
├── boto_formatter.PNG
└── s3_list_out.PNG
├── pyproject.toml
├── src
└── boto_formatter
│ ├── __init__.py
│ ├── boto_magic_formatter.py
│ ├── core_formatter.py
│ ├── json_util
│ ├── __init__.py
│ └── json_util.py
│ ├── service_config_mgr
│ ├── __init__.py
│ ├── service_config.py
│ └── service_configs
│ │ ├── accessanalyzer.json
│ │ ├── account.json
│ │ ├── acm.json
│ │ ├── amp.json
│ │ ├── apigateway.json
│ │ ├── budgets.json
│ │ ├── cleanrooms.json
│ │ ├── cloudformation.json
│ │ ├── cloudfront.json
│ │ ├── cloudtrail.json
│ │ ├── cloudwatch.json
│ │ ├── codecommit.json
│ │ ├── dynamodb.json
│ │ ├── ec2.json
│ │ ├── ecs.json
│ │ ├── efs.json
│ │ ├── eks.json
│ │ ├── elasticache.json
│ │ ├── elbv2.json
│ │ ├── emr-serverless.json
│ │ ├── emr.json
│ │ ├── iam.json
│ │ ├── kms.json
│ │ ├── lambda.json
│ │ ├── organizations.json
│ │ ├── rds.json
│ │ ├── redshift-serverless.json
│ │ ├── redshift.json
│ │ ├── resourcegroupstaggingapi.json
│ │ ├── route53.json
│ │ ├── route53domains.json
│ │ ├── s3.json
│ │ ├── sagemaker.json
│ │ ├── sns.json
│ │ ├── sqs.json
│ │ └── ssm.json
│ └── service_formatter.py
└── tests
├── boto_magic_formatter_usage.py
├── core_formatter_usages
├── accessanalyzer_usage.py
├── apigateway_usage.py
├── budgets_usage.py
├── cloudfront_usage.py
├── cloudtrail_usage.py
├── dynamodb_usage.py
├── ec2_usage.py
├── ecs_usage.py
├── efs_usage.py
├── eks_usage.py
├── elbv2_usage.py
├── emr-serverless_usage.py
├── emr_usage.py
├── general_usage.py
├── iam_usage.py
├── lambda_usage.py
├── organizations_usage.py
├── rds_usage.py
├── redshift-serverless_usage.py
├── redshift_usage.py
├── route53_usage.py
├── s3_usage.py
├── sns_usage.py
└── sqs_usage.py
└── s3_inventory_usage.py
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | ## Code of Conduct
2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4 | opensource-codeofconduct@amazon.com with any additional questions or comments.
5 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing Guidelines
2 |
3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4 | documentation, we greatly value feedback and contributions from our community.
5 |
6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7 | information to effectively respond to your bug report or contribution.
8 |
9 |
10 | ## Reporting Bugs/Feature Requests
11 |
12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13 |
14 | When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16 |
17 | * A reproducible test case or series of steps
18 | * The version of our code being used
19 | * Any modifications you've made relevant to the bug
20 | * Anything unusual about your environment or deployment
21 |
22 |
23 | ## Contributing via Pull Requests
24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25 |
26 | 1. You are working against the latest source on the *main* branch.
27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29 |
30 | To send us a pull request, please:
31 |
32 | 1. Fork the repository.
33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34 | 3. Ensure local tests pass.
35 | 4. Commit to your fork using clear commit messages.
36 | 5. Send us a pull request, answering any default questions in the pull request interface.
37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
38 |
39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41 |
42 |
43 | ## Finding contributions to work on
44 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
45 |
46 |
47 | ## Code of Conduct
48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
50 | opensource-codeofconduct@amazon.com with any additional questions or comments.
51 |
52 |
53 | ## Security issue notifications
54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
55 |
56 |
57 | ## Licensing
58 |
59 | See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
60 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT No Attribution
2 |
3 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
13 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
15 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include boto_formatter/service_config_mgr/service_configs/*.json
2 | recursive-include boto_formatter *.json
3 | global-include *.json
4 | global-exclude *.pyc
--------------------------------------------------------------------------------
/docs/setup.md:
--------------------------------------------------------------------------------
1 |
2 | ## Prerequisites
3 |
4 | Python is required to run the boto_formatter.
5 | Download python https://www.python.org/downloads/
6 |
7 |
8 | ## Setup
9 | ### 1. Clone the Repository
10 | Clone the boto_formatter github repository to your computer using the following command
11 | ```
12 | git clone https://github.com/awslabs/boto-formatter.git
13 | ```
14 |
15 | ### 2. Generating distribution archives from source code
16 |
17 | **Unix/macOS**
18 | ```
19 | cd boto-formatter
20 |
21 | python3 -m pip install --upgrade build
22 |
23 | python3 -m build
24 | ```
25 |
26 | **Windows**
27 | ```
28 | cd boto-formatter
29 |
30 | py -m pip install --upgrade build
31 |
32 | py -m build
33 | ```
34 | Running build command will generate dist folder and creates following two files in the dist directory:
35 |
36 | 1. **boto_formatter-1.0.0.tar.gz**
37 | 2. **boto_formatter-1.0.0-py3-none-any.whl**
38 |
39 |
40 | ### 3. Create project directory
41 | ```
42 | mkdir boto3_formatter_test
43 | cd boto3_formatter_test
44 |
45 | ```
46 | Copy the distribution file **boto_formatter-1.0.0.tar.gz** to project directory.
47 |
48 | To test the functionality, copy any usage file example s3_usage.py from **tests/s3_usage.py** to project directory
49 |
50 | ### 4. Create Python virtual environment
51 | Follow the instruction depending upon your OS
52 |
53 | **Unix/macOS**
54 |
55 | 4.1 Create virtual environment
56 | ```
57 | python3 -m venv .venv
58 | ```
59 | 4.2 Activate python virtual environment
60 | ```
61 | source .venv/bin/activate
62 | ```
63 | 4.3 Install boto_formatter library and boto3 sdk
64 | ```
65 | pip install boto_formatter-1.0.0.tar.gz
66 | pip install boto3
67 |
68 | ```
69 | **Windows**
70 |
71 | 4.1 Create virtual environment
72 | ```
73 | python -m venv .venv
74 | ```
75 | 4.2 Activate python virtual environment
76 | ```
77 | cd .venv/scripts
78 | activate
79 | ```
80 | 4.3 Go up to the directory to project directory
81 | ```
82 | cd ..
83 | cd ..
84 | ```
85 |
86 | 4.4. Install boto_formatter library and boto3 sdk
87 | ```
88 | pip install boto_formatter-1.0.0.tar.gz
89 | pip install boto3
90 |
91 | ```
92 |
93 | **You have successfully installed boto_formatter **
94 |
95 | # Test
96 |
97 | Run the s3_usage.py
98 |
99 | **Unix/macOS**
100 | ```
101 | python3 s3_usage.py
102 | ```
103 |
104 | **Windows**
105 | ```
106 | python s3_usage.py
107 | ```
108 |
109 | Output folder will be created with list of s3 buckets. Review the sample code (s3_usage.py) [https://github.com/awslabs/boto-formatter.git/-/blob/main/tests/s3_usage.py]
110 |
111 |
112 |
113 |
114 | ## Optional: Explore additional features
115 |
116 | You can explore other AWS services like iam, s3 ..and generate the output as csv, json. You can also send the output to file or print list on command prompt to explore these options (click here)[https://github.com/awslabs/boto-formatter.git/-/blob/main/tests/general_usage.py]
117 |
118 |
119 | # Cleanup
120 |
121 | 1. Delete the Output folder
122 | 2. Uninstall pip uninstall boto_formatter-1.0.0.tar.gz
123 | 3. Uninstall pip uninstall boto3
124 |
--------------------------------------------------------------------------------
/docs/supported_services.md:
--------------------------------------------------------------------------------
1 | Click on service to see the usage
2 |
3 |
4 |
5 | Service |
6 | Functions |
7 |
8 |
9 | General usage |
10 | General usage |
11 |
12 |
13 | accessanalyzer |
14 |
15 |
16 | - 1.list_analyzers
17 | - 2.list_findings
18 |
19 | |
20 |
21 |
22 | apigateway |
23 |
24 |
25 | - 3.get_rest_apis
26 |
27 | |
28 |
29 |
30 | budgets |
31 |
32 |
33 | - 4.describe_budgets
34 |
35 | |
36 |
37 |
38 | cloudfront |
39 |
40 |
41 | - 5.list_distributions
42 | - 6.list_functions
43 |
44 | |
45 |
46 |
47 | cloudtrail |
48 |
49 |
52 | |
53 |
54 |
55 | cloudwatch |
56 |
57 |
58 | - 8.list_dashboards
59 | - 9.list_metrics
60 |
61 | |
62 |
63 |
64 | codecommit |
65 |
66 |
67 | - 10.list_repositories
68 |
69 | |
70 |
71 |
72 | dynamodb |
73 |
74 |
77 | |
78 |
79 |
80 | ec2 |
81 |
82 |
83 | - 12.describe_addresses
84 | - 13.describe_flow_logs
85 | - 14.describe_instances
86 | - 15.describe_network_acls
87 | - 16.describe_route_tables
88 | - 17.describe_security_groups
89 | - 18.describe_security_group_rules
90 | - 19.describe_snapshots
91 | - 20.describe_subnets
92 | - 21.describe_transit_gateways
93 | - 22.describe_volumes
94 | - 23.describe_vpcs
95 | - 24.describe_vpc_endpoints
96 | - 25.describe_vpc_peering_connections
97 | - 26.describe_vpn_connections
98 |
99 | |
100 |
101 |
102 | ecs |
103 |
104 |
105 | - 27.list_clusters
106 | - 28.list_services
107 | - 29.list_tasks
108 |
109 | |
110 |
111 |
112 | efs |
113 |
114 |
115 | - 30.describe_file_systems
116 |
117 | |
118 |
119 |
120 | eks |
121 |
122 |
123 | - 31.describe_cluster
124 | - 32.list_clusters
125 | - 33.list_fargate_profiles
126 |
127 | |
128 |
129 |
130 | elasticache |
131 |
132 |
133 | - 34.describe_cache_clusters
134 |
135 | |
136 |
137 |
138 | elbv2 |
139 |
140 |
141 | - 35.describe_load_balancers
142 |
143 | |
144 |
145 |
146 | emr-serverless |
147 |
148 |
149 | - 36.list_applications
150 | - 37.list_job_runs
151 |
152 | |
153 |
154 |
155 | emr |
156 |
157 |
158 | - 38.list_clusters
159 | - 39.list_instance_fleets
160 | - 40.list_notebook_executions
161 | - 41.list_studios
162 |
163 | |
164 |
165 |
166 | iam |
167 |
168 |
169 | - 42.list_users
170 | - 43.list_access_keys
171 | - 44.list_account_aliases
172 | - 45.list_attached_group_policies
173 | - 46.list_attached_role_policies
174 | - 47.list_attached_user_policies
175 | - 48.list_group_policies
176 | - 49.list_groups
177 | - 50.list_policies
178 | - 51.list_roles
179 |
180 | |
181 |
182 |
183 | kms |
184 |
185 |
188 | |
189 |
190 |
191 | lambda |
192 |
193 |
194 | - 53.list_functions
195 | - 54.list_layers
196 |
197 | |
198 |
199 |
200 | organizations |
201 |
202 |
203 | - 55.list_accounts
204 | - 56.list_policies
205 |
206 | |
207 |
208 |
209 | rds |
210 |
211 |
212 | - 57.describe_db_clusters
213 | - 58.describe_db_instances
214 | - 59.describe_db_security_groups
215 | - 60.describe_db_snapshots
216 | - 61.describe_global_clusters
217 |
218 | |
219 |
220 |
221 | redshift-serverless |
222 |
223 |
224 | - 62.list_namespaces
225 | - 63.list_workgroups
226 |
227 | |
228 |
229 |
230 | redshift |
231 |
232 |
233 | - 64.describe_clusters
234 |
235 | |
236 |
237 |
238 | route53 |
239 |
240 |
241 | - 65.list_cidr_blocks
242 | - 66.list_hosted_zones
243 | - 67.list_hosted_zones_by_vpc
244 | - 68.list_vpc_association_authorizations
245 |
246 | |
247 |
248 |
249 | route53domains |
250 |
251 |
252 | - 69.list_domains
253 | - 70.list_prices
254 |
255 | |
256 |
257 |
258 | s3 |
259 |
260 |
261 | - 71.create_bucket
262 | - 72.list_buckets
263 | - 73.list_multipart_uploads
264 | - 74.list_objects_v2
265 |
266 | |
267 |
268 |
269 | sns |
270 |
271 |
272 | - 75.list_subscriptions
273 | - 76.list_topics
274 |
275 | |
276 |
277 |
278 | sqs |
279 |
280 |
281 | - 77.list_queues
282 |
283 | |
284 |
285 |
286 |
287 |
--------------------------------------------------------------------------------
/imgs/boto_formatter.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awslabs/boto-formatter/607406cb089c005c278c12f662e0eee28a9fa7de/imgs/boto_formatter.PNG
--------------------------------------------------------------------------------
/imgs/s3_list_out.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awslabs/boto-formatter/607406cb089c005c278c12f662e0eee28a9fa7de/imgs/s3_list_out.PNG
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 |
2 | [build-system]
3 | requires = ["setuptools>=61.0"]
4 | build-backend = "setuptools.build_meta"
5 |
6 | [project]
7 | name = "boto_formatter"
8 | version = "2.0.0"
9 | authors = [
10 | { name="Abhijit Rajeshirke", email="rajeabh@amazon.com" },
11 | ]
12 | description = "boto3 response formatter"
13 | readme = "README.md"
14 | requires-python = ">=3.7"
15 | classifiers = [
16 | "Programming Language :: Python :: 3",
17 | "License :: OSI Approved :: MIT License",
18 | "Operating System :: OS Independent",
19 | ]
20 |
21 | [project.urls]
22 | "Homepage" = "https://github.com/awslabs/boto-formatter"
23 | "Bug Tracker" = "https://github.com/awslabs/boto-formatter/issues"
--------------------------------------------------------------------------------
/src/boto_formatter/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awslabs/boto-formatter/607406cb089c005c278c12f662e0eee28a9fa7de/src/boto_formatter/__init__.py
--------------------------------------------------------------------------------
/src/boto_formatter/core_formatter.py:
--------------------------------------------------------------------------------
1 | import logging
2 | from sys import modules
3 | import os
4 | import boto_formatter.json_util.json_util as json_util
5 | from boto_formatter.service_config_mgr.service_config import ServiceConfig
6 |
7 |
8 | # Set up our logger
9 | logging.basicConfig(level=logging.ERROR)
10 | logger = logging.getLogger()
11 |
12 |
13 | def boto_response_formatter(service_name, function_name, **kwargs):
14 | """
15 | boto core response formatter
16 | :param service_name: example lambda, s3
17 | :param function_name: example list_functions
18 | :param format_type: json or csv
19 | :param output_to: print or file
20 | :param output_path: file output path
21 | :param pagination: result is generated through pagination
22 | :param required_only: format result for required only columns
23 | :return: formatted response
24 | """
25 | required_only = None # Default is none if required only fields
26 | format_type = None # Options are json or csv. Default is json
27 | output_to = None # Options are print or file. Default is print
28 | output_path = None # Default is none, user can provide custom path
29 | prefix_columns = None
30 | pagination = None
31 |
32 | # FORMAT_1 : JSON single record
33 | # FORMAT_2 : JSON contains List of JSON
34 | # FORMAT_3 : JSON contains List of Strings
35 | COMMON_FORMAT = "FORMAT_2"
36 |
37 | # default type is json. Supported types are json,csv
38 | if "format_type" in kwargs:
39 | format_type = kwargs["format_type"].lower()
40 | # output_to default is None. Supported options are cmd,file,s3
41 | if "output_to" in kwargs:
42 | output_to = kwargs["output_to"]
43 | # output_to default is None. Supported options are complete file path or S3 path
44 | if "output_path" in kwargs:
45 | output_path = kwargs["output_path"]
46 | if "prefix_columns" in kwargs:
47 | prefix_columns = kwargs["prefix_columns"]
48 | if "pagination" in kwargs:
49 | pagination = True
50 | if "required_only" in kwargs:
51 | required_only = "Yes"
52 |
53 | def format_decorator(f):
54 |
55 | def wrapped(*args, **kwargs):
56 | response = f(*args, **kwargs)
57 | # If output_path is not provided set as invoking function directory path
58 | func_dir_path = None
59 | try:
60 | func_dir_path = os.path.dirname(
61 | os.path.abspath(modules[f.__module__].__file__))
62 | except AttributeError as err:
63 | logger.error(err)
64 | logger.debug(
65 | "running from command prompt")
66 | func_dir_path = os.getcwd()
67 |
68 | logger.debug("Function directory Path : {}".format(func_dir_path))
69 | json_config = None
70 | result = None
71 | function_config = ServiceConfig.get_service_function_details(
72 | service_name, function_name)
73 |
74 | json_config = function_config["json_response"]
75 | response_format = function_config["response_format"]
76 | # Some columns breaks as comma so for csv format put required only condition
77 |
78 | result = __process_service_func_response(
79 | function_config, json_config, format_type, required_only, response, prefix_columns, pagination)
80 | # default result is in flatten json format.
81 | if format_type:
82 | result = __format_ouput(result, format_type)
83 | if output_to:
84 | result = __ouput_to(service_name, function_name,
85 | result, output_to, format_type,
86 | output_path, func_dir_path, response_format)
87 | return result
88 | return wrapped
89 | return format_decorator
90 |
91 |
92 | def __process_service_func_response(function_config, json_config, format_type, required_only, response, prefix_columns, pagination):
93 | """
94 | :param function_config : function defined in service_config.json
95 | :param json_config: reference response
96 | :param format_type: csv,json
97 | :param required_only: if present filter the result for required onlydata
98 | :param response : response of base function
99 | :prefix_columns : Addtional prefix columns to print
100 | :pagination :if present json list is part of pagination
101 | :return: formatted list of flattend JSON objects
102 | """
103 | response_format = function_config["response_format"]
104 | result_keys = None
105 | result = []
106 | if "result_keys" in function_config.keys():
107 | result_keys = function_config["result_keys"]
108 | # Come columns breaks in csv format so added this condition to exclued these columns
109 | if required_only is None and format_type is not None:
110 | if "csv_enforced_required_only" in function_config.keys() and format_type == "csv":
111 | required_only = "Yes"
112 | # FORMAT_1 : JSON single record
113 | # FORMAT_2 : JSON contains List of JSON
114 | # FORMAT_3 : JSON contains List of Strings
115 | if response_format == "FORMAT_2":
116 | # if pagination then get extended loop
117 | if pagination:
118 | for obj in response:
119 | result.extend(json_util.format_json_list(json_config, json_util.format_response_for_result_keys(
120 | obj, result_keys), required_only, prefix_columns))
121 | else:
122 | result = json_util.format_json_list(json_config, json_util.format_response_for_result_keys(
123 | response, result_keys), required_only, prefix_columns)
124 |
125 | elif response_format == "FORMAT_1":
126 | result = json_util.format_json_object(json_config, response)
127 |
128 | elif response_format == "FORMAT_3":
129 | if pagination:
130 | for obj in response:
131 | result.extend(json_util.format_str_list(json_config, json_util.format_response_for_result_keys(
132 | obj, result_keys), required_only, prefix_columns))
133 | else:
134 | result = json_util.format_str_list(json_config, json_util.format_response_for_result_keys(
135 | response, result_keys), required_only, prefix_columns)
136 | return result
137 |
138 |
139 | def __format_ouput(result, format_type):
140 | """
141 | :param result : Flatten JSON list
142 | :param format_type: currently supported only csv
143 | :return: formatted list of comma seperated string
144 | """
145 | if format_type == "csv":
146 | return json_util.get_csv_data(result)
147 | else:
148 | return result
149 |
150 |
151 | def __ouput_to(service_name, function_name, result, output_to, format_type, output_path, func_dir_path, response_format):
152 | """
153 | :param service_name :service_name like s3, lambda
154 | :param function_name: function name like list_buckets
155 | :param function_name: processed result
156 | :param format_type: csv or json
157 | :param output_path: user provided output_path to save file
158 | :param func_dir_path: invoking file directory path
159 | :response_format:FORMAT_1,FORMAT_2,FORMAT_3
160 | :return: formatted list of comma seperated string
161 | """
162 | if output_to == "print":
163 | return json_util.print_csv_response(result)
164 | elif output_to == "file" or output_to == "s3":
165 | if output_path is None:
166 | output_path = func_dir_path
167 | logging.debug("Directory Path : {}".format(output_path))
168 | if format_type:
169 | file_path = None
170 | if format_type == "csv":
171 | file_path = json_util.save_csv(
172 | result, service_name, function_name, output_path)
173 | else:
174 | file_path = json_util.save_json(
175 | result, service_name, function_name, output_path)
176 |
177 | return file_path
178 | else:
179 | return result
180 |
--------------------------------------------------------------------------------
/src/boto_formatter/json_util/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awslabs/boto-formatter/607406cb089c005c278c12f662e0eee28a9fa7de/src/boto_formatter/json_util/__init__.py
--------------------------------------------------------------------------------
/src/boto_formatter/json_util/json_util.py:
--------------------------------------------------------------------------------
1 | """
2 | This is general JSON utility
3 |
4 | """
5 | import datetime
6 | import os
7 | import json
8 | import logging
9 | logger = logging.getLogger()
10 | logger.setLevel(logging.ERROR)
11 |
12 |
13 | def flatten_json(y):
14 | """
15 | Flatten JSON
16 | :param json to be flatten
17 | :return: flattend json
18 | """
19 | output = {}
20 |
21 | def flatten(x, name=''):
22 | if type(x) is dict:
23 | for a in x:
24 | flatten(x[a], name + a + '_')
25 | elif type(x) is list:
26 | i = 0
27 | for a in x:
28 | flatten(a, name + str(i) + '_')
29 | i += 1
30 | else:
31 | output[name[:-1]] = x
32 | flatten(y)
33 | return output
34 |
35 |
36 | def format_response_for_result_keys(json_object_list, result_keys):
37 | """
38 | Iterate over result keys in JSON to get appropriate List
39 | :param json_object_list -JSON object which contains result_key(or Keys)
40 | :param result_keys - List of Keys to be search in JSON
41 | :return: List of JSON objects
42 | """
43 | """"""
44 | try:
45 | for result_key in result_keys:
46 | if len(json_object_list) > 0:
47 | json_object_list = json_object_list[result_key]
48 | except KeyError as err:
49 | # This is to handle when pagination iterate even though there is no record
50 | json_object_list = []
51 | logger.debug(err)
52 | #logger.error(err)
53 | #raise ValueError(
54 | # "Result Keys {} not found in provided JSON. Decorator service/function is not matching with boto function".format(result_keys))
55 | except TypeError as err:
56 | logger.error(err)
57 | raise ValueError(
58 | "Result List returned by boto3 function is not in correct format or decorator service/function is not matching with boto function")
59 | return json_object_list
60 |
61 |
62 | def format_json_list(json_config, json_object_list, required_only, prefix_columns=None):
63 | """
64 | Prior :
65 | Filter Result Keys
66 | Append addtional columns
67 | Compare all objects in JSON List with reference json(json_config) and generate list
68 | 1. Iterate each object in List
69 | 2. Flatten the object
70 | 3. Get Keys of reference JSON
71 | 4. Iterate over reference JSON keys and generate result row
72 | 5. Update result rows with not found keys (Extra Columns)
73 | :param json_config -reference json
74 | :param json_object_list - json list that need to be formatted
75 | :param required_only - if interest is only in required only attributes
76 | :param prefix_columns -if addtional prefix columns you want to add in response
77 | :return: return json object list formatted in line with json_config
78 | """
79 | result_json_list = []
80 | json_config_keys = json_config.keys()
81 | First_record = True
82 | # 1 Take each object in list
83 | # 1 Outer Loop
84 | # if json_object_list is zero size loop will not execute
85 | for json_object_raw in json_object_list:
86 | # 2 Flatten the object
87 | json_object = flatten_json(json_object_raw)
88 | result_row = {}
89 | keys_present_list = []
90 | # 3 Append Prefix columns values like Account, Region
91 | if prefix_columns:
92 | for prefix_column_header in prefix_columns.keys():
93 | result_row[prefix_column_header] = prefix_columns[prefix_column_header]
94 | # 4. Get keys of reference JSON
95 | json_object_keys = json_object.keys()
96 | # 5 Go Through All the keys of reference JSON
97 | for json_config_key in json_config_keys:
98 | if json_config_key in json_object_keys:
99 | result_row[json_config_key] = str(json_object[json_config_key])
100 | keys_present_list.append(json_config_key)
101 | else:
102 | result_row[json_config_key] = ""
103 | # 6. Append Extra Cloumns as pipe seprated Key/Value
104 | # If required_only is selected don't need extra columns
105 | if not required_only:
106 | extra_rows = [
107 | i for i in json_object_keys if i not in keys_present_list]
108 | for extra_row_key in extra_rows:
109 | result_row[extra_row_key] = "{}|{}".format(
110 | extra_row_key, json_object[extra_row_key])
111 | # 7 None of key matches for first row raise and exception as it's not valid JSON
112 | if First_record:
113 | if len(keys_present_list) == 0:
114 | raise ValueError(
115 | "Zero record keys are matching. Check the JSON result is appropriate format")
116 | First_record = False
117 | result_json_list.append(result_row)
118 | return result_json_list
119 |
120 |
121 | def format_str_list(json_config, json_object_list, required_only, prefix_columns=None):
122 | """
123 | Prior :
124 | Filter Result Keys
125 | Append addtional columns
126 | Iterate each string and convert to JSON
127 |
128 | :param json_config -reference json
129 | :param json_object_list - json list that need to be formatted
130 | :param required_only - if interest is only in required only attributes
131 | :param prefix_columns -if addtional prefix columns you want to add in response
132 | :return: return json object list formatted in line with json_config
133 | """
134 | result_json_list = []
135 | #Ensure first Key is present
136 | column_key = list(json_config.keys())[0]
137 | # 1 Take each string in list
138 | # 1 Outer Loop
139 | # if json_object_list is zero size loop will not execute
140 | for str_obj in json_object_list:
141 | result_row = {}
142 | # 2 Append Prefix columns values like Account, Region
143 | if prefix_columns:
144 | for prefix_column_header in prefix_columns.keys():
145 | result_row[prefix_column_header] = prefix_columns[prefix_column_header]
146 | # 3. Ensure first Key is present
147 | result_row[column_key] = str_obj
148 | result_json_list.append(result_row)
149 | return result_json_list
150 |
151 |
152 |
153 | def format_json_object(json_config, json_object_raw):
154 | """
155 | Compare Json_object with reference json(json_config) and generate JSON Object
156 | 1. Flatten the object
157 | 2. Get Keys of reference JSON
158 | 3. Iterate over reference JSON keys and generate result row
159 | 4. Update result rows with not found keys (Extra Columns)
160 | :param json_config -reference json
161 | :param json_object_raw - json object to be formatted
162 | :return: return json object formated in line with json_config
163 | """
164 | json_config_keys = json_config.keys()
165 | # 2 Flatten the object
166 | json_object = flatten_json(json_object_raw)
167 | result_row = {}
168 | keys_present_list = []
169 | # 3. Get keys of reference JSON
170 | json_object_keys = json_object.keys()
171 | # 4 Go Through All the keys of reference JSON
172 | for json_config_key in json_config_keys:
173 | if json_config_key in json_object_keys:
174 | result_row[json_config_key] = str(json_object[json_config_key])
175 | keys_present_list.append(json_config_key)
176 | else:
177 | result_row[json_config_key] = ""
178 | # 5. Append Extra Cloumns as pipe seprated Key/Value
179 | extra_rows = [i for i in json_object_keys if i not in keys_present_list]
180 | for extra_row_key in extra_rows:
181 | result_row[extra_row_key] = "{}|{}".format(
182 | extra_row_key, json_object[extra_row_key])
183 |
184 | return result_row
185 |
186 |
187 | def get_csv_data(result_json_list):
188 | """
189 | :param flattend json object list
190 | :return: list of comma seperated string
191 | """
192 | csv_data = []
193 | if len(result_json_list) > 0:
194 | logger.debug(result_json_list)
195 | csv_data.append(",".join(result_json_list[0].keys()))
196 | for json_obj in result_json_list:
197 | csv_data.append(",".join(replace_breaking_comma(json_obj.values())))
198 | return csv_data
199 |
200 | def replace_breaking_comma(json_obj_values):
201 | return [obj_value.replace(',', '/n') for obj_value in json_obj_values]
202 |
203 | def print_csv_response(csv_data):
204 | """
205 | :param list of comma seperated string
206 | :return: None
207 | """
208 | for csv_value in csv_data:
209 | print(csv_value)
210 |
211 |
212 | def get_output_path():
213 | """
214 | :return: output_path
215 | """
216 | dir_path = os.path.dirname(os.path.abspath(__file__))
217 | return dir_path
218 |
219 |
220 | def get_file_path(service_name, function_name, dir_path, file_type):
221 | """
222 | Generate file path based on service_name and function_name
223 | :param service_name like s3, lambda
224 | :param function_name like list_buckets
225 | :return: None
226 | """
227 | if not os.path.exists(dir_path):
228 | ValueError("Invalid Path to store the file {}".format(dir_path))
229 | current_date = datetime.datetime.now().strftime("%d_%m_%Y_%H_%M_%S")
230 | file_name = "{}_{}_{}.{}".format(
231 | service_name, function_name, current_date, file_type)
232 | output_path = os.path.join(dir_path, "output")
233 | logger.info("Output directory path {} ".format(output_path))
234 | if not os.path.exists(output_path):
235 | os.mkdir(output_path)
236 | file_path = os.path.join(output_path, file_name)
237 | logger.info("File Path {}".format(file_path))
238 | return file_path
239 |
240 |
241 | def save_csv(csv_data, service_name, function_name, dir_path):
242 | """
243 | save file as .csv
244 | :param csv_data data in list of comma seperated strings
245 | :param service_name like s3, lambda
246 | :param function_name like list_buckets
247 | :return: None
248 | """
249 | file_full_path = None
250 | if len(csv_data) > 0:
251 | file_full_path = get_file_path(
252 | service_name, function_name, dir_path, "csv")
253 | f = open(file_full_path, "w")
254 | for row in csv_data:
255 | f.write(row + "\n")
256 | print("RESULT : File is generated at location {} ".format(file_full_path))
257 | else:
258 | print("RESULT : No records . ")
259 | return file_full_path
260 |
261 |
262 | def save_json(json_data, service_name, function_name, dir_path=None):
263 | """
264 | save file as .json
265 | :param json_data json formatted data
266 | :param service_name like s3, lambda
267 | :param function_name like list_buckets
268 | :return: None
269 | """
270 | file_full_path = None
271 | if len(json_data) > 0:
272 | json_data_list = dict()
273 | json_data_list["result"] = json_data
274 | file_full_path = get_file_path(
275 | service_name, function_name, dir_path, "json")
276 | json_data_list = json.dumps(json_data_list, indent=4, default=str)
277 | # Writing to sample.json
278 | with open(file_full_path, "w") as outfile:
279 | outfile.write(json_data_list)
280 | print("RESULT : File is generated at location {} ".format(file_full_path))
281 | else:
282 | print("RESULT : No records . ")
283 | return file_full_path
284 |
285 |
286 | def save_file(json_data, service_name, function_name, dir_path=None):
287 | file_full_path = get_file_path(
288 | service_name, function_name, dir_path, "json")
289 | # Writing to sample.json
290 | with open(file_full_path, "w") as outfile:
291 | outfile.write(json_data)
292 | print("RESULT : File is generated at location {} ".format(file_full_path))
293 |
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awslabs/boto-formatter/607406cb089c005c278c12f662e0eee28a9fa7de/src/boto_formatter/service_config_mgr/__init__.py
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_config.py:
--------------------------------------------------------------------------------
1 | """
2 | Read all the service definations from service_configs and store the values
3 | in dictionary.
4 |
5 | """
6 | import logging
7 | import os
8 | import json
9 |
10 | logging.basicConfig(level=logging.ERROR)
11 | logger = logging.getLogger()
12 |
13 |
14 | def get_service_name(file_name):
15 | """
16 | File should be in .json format
17 | This function strip last four character .json and return value
18 | :param file_name
19 | :return: service_name
20 | """
21 | json_file_name = None
22 | try:
23 | file_len = len(file_name)
24 | if file_name[file_len-5:file_len] ==".json":
25 | json_file_name = file_name[0:len(file_name)-5]
26 |
27 | except Exception as err:
28 | logger.error(err)
29 | ERROR_MESSAGE = " Invalid file {} found in service_config directory. service_config shoudl contain only .json files".format(
30 | file_name)
31 | raise ValueError(ERROR_MESSAGE)
32 |
33 | return json_file_name
34 |
35 |
36 | class ServiceConfig():
37 | """ This class hold the values from service_configs"""
38 | __data = {}
39 | __service_functions_data= []
40 |
41 | @classmethod
42 | def load_all_service_data(cls):
43 | """ Load config values for all services"""
44 | try:
45 | dir_path = os.path.dirname(os.path.abspath(__file__))
46 | dir_path_service = os.path.join(dir_path, "service_configs")
47 | for service_file in os.listdir(dir_path_service):
48 | service_name = get_service_name(service_file)
49 | if service_name is not None:
50 | logger.info("{}.json found ".format(service_name))
51 | file_path = os.path.join(dir_path_service, service_file)
52 | f = open(file_path)
53 | temp_data = json.load(f)
54 | service_name = temp_data["service_name"]
55 | ServiceConfig.__data[service_name] = {}
56 | ServiceConfig.__data[service_name]["service_name"] = service_name
57 | for function_details in temp_data["functions"]:
58 | function_name = function_details["function_name"]
59 | ServiceConfig.__data[service_name][function_name] = ServiceConfig.__process_function_details(
60 | function_details)
61 | f.close()
62 | except KeyError as err:
63 | logger.error(
64 | "Please check service_config.json file . File syntax is not correct.")
65 | raise err
66 | except FileNotFoundError as err:
67 | logger.error(
68 | "File service_config.json file is not Found. Please check aws_account_config.json file exists")
69 | raise err
70 | except IOError as err:
71 | logger.error(
72 | " IO error while loading the file aws_account_config.json {}. ".format(err))
73 | raise err
74 |
75 |
76 | @classmethod
77 | def get_service_functions_list(cls):
78 | """ Get all services and their functions"""
79 |
80 | if len(ServiceConfig.__service_functions_data) > 0:
81 | return ServiceConfig.__service_functions_data
82 | else:
83 | try:
84 | dir_path = os.path.dirname(os.path.abspath(__file__))
85 | dir_path_service = os.path.join(dir_path, "service_configs")
86 |
87 | for service_file in os.listdir(dir_path_service):
88 | service_name = get_service_name(service_file)
89 | if service_name is not None:
90 | logger.info("{}.json found ".format(service_name))
91 | file_path = os.path.join(dir_path_service, service_file)
92 | f = open(file_path)
93 | temp_data = json.load(f)
94 | service_name = temp_data["service_name"]
95 | service_dict = dict()
96 | function_list =[]
97 |
98 | for function_details in temp_data["functions"]:
99 | function_dict =dict()
100 | function_dict["function_name"] = function_details["function_name"]
101 | function_dict["function_description"] = function_details["function_description"]
102 | if "pagination_attributes" in function_details.keys():
103 | function_dict["pagination_attributes"] = function_details["pagination_attributes"]
104 | function_list.append(function_dict)
105 | service_dict["service_name"] = service_name
106 | service_dict["function_list"] = function_list
107 | ServiceConfig.__service_functions_data.append(service_dict)
108 | f.close()
109 |
110 | except KeyError as err:
111 | logger.error(
112 | "Please check service_config.json file . File syntax is not correct.")
113 | raise err
114 | except FileNotFoundError as err:
115 | logger.error(
116 | "File service_config.json file is not Found. Please check aws_account_config.json file exists")
117 | raise err
118 | except IOError as err:
119 | logger.error(
120 | " IO error while loading the file aws_account_config.json {}. ".format(err))
121 | raise err
122 | return ServiceConfig.__service_functions_data
123 |
124 | @classmethod
125 | def load_service_data(cls, service_name):
126 | """ Load config values for perticular service from .json file in service_configs folder"""
127 | logger.info("loading Data for service_name {}...".format(service_name))
128 | try:
129 | dir_path = os.path.dirname(os.path.abspath(__file__))
130 | dir_path_service = os.path.join(dir_path, "service_configs")
131 | for service_file in os.listdir(dir_path_service):
132 | if service_name == get_service_name(service_file):
133 | file_path = os.path.join(dir_path_service, service_file)
134 | temp_data = None
135 | with open(file_path, "r+") as f:
136 | temp_data = json.load(f)
137 | f.close()
138 | service_name = temp_data["service_name"]
139 | ServiceConfig.__data[service_name] = {}
140 | ServiceConfig.__data[service_name]["service_name"] = service_name
141 | for function_details in temp_data["functions"]:
142 | function_name = function_details["function_name"]
143 | ServiceConfig.__data[service_name][function_name] = ServiceConfig.__process_function_details(
144 | function_details)
145 |
146 | except KeyError as err:
147 | logger.error(
148 | "Please check service_config.json file . File syntax is not correct.")
149 | raise err
150 | except FileNotFoundError as err:
151 | logger.error(
152 | "File service_config.json file is not Found. Please check aws_account_config.json file exists")
153 | raise err
154 | except IOError as err:
155 | logger.error(
156 | " IO error while loading the file aws_account_config.json {}. ".format(err))
157 | raise err
158 |
159 | @ classmethod
160 | def get_service_function_details(cls, service_name, function_name):
161 | function_config = None
162 | try:
163 | if service_name in ServiceConfig.__data.keys():
164 | if function_name in ServiceConfig.__data[service_name]:
165 | function_config = ServiceConfig.__data[service_name][function_name]
166 | else:
167 | ServiceConfig.load_service_data(service_name)
168 | # Second Iteration don't catch the exception
169 | function_config = ServiceConfig.__data[service_name][function_name]
170 | except KeyError as err:
171 | ERROR_MESSAGE = " Either Service config {}.json not found in service_configs folder or function {} is not defined in {}.json".format(
172 | service_name, function_name, service_name)
173 | logger.error(err)
174 | raise ValueError(ERROR_MESSAGE)
175 | return function_config
176 |
177 | @ classmethod
178 | def __process_function_details(cls, function_details):
179 | """ Add required only json_response """
180 | json_response_required = dict()
181 | json_response = function_details["json_response"]
182 | for key in json_response.keys():
183 | if json_response[key] == "required":
184 | json_response_required[key] = json_response[key]
185 | function_details["json_response_required"] = json_response_required
186 | return function_details
187 |
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/accessanalyzer.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "accessanalyzer",
3 | "functions": [
4 | {
5 | "function_name": "list_analyzers",
6 | "function_description": "Retrieves a list of analyzers.",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "N",
11 | "pagination_support": "Y",
12 | "implclass": "_global_paginate",
13 | "implfunction": "process",
14 | "validation_functions": "",
15 | "is_multi_account_support": "Y",
16 | "result_keys": [
17 | "analyzers"
18 | ],
19 | "json_response": {
20 | "arn": "*",
21 | "name": "*",
22 | "type": "*",
23 | "createdAt": "*",
24 | "lastResourceAnalyzed": "",
25 | "lastResourceAnalyzedAt": "",
26 | "tags_string": "",
27 | "status": "",
28 | "statusReason_code": ""
29 | }
30 | },
31 | {
32 | "function_name": "list_findings",
33 | "function_description": "Returns information about the access key IDs associated with the specified IAM user",
34 | "boto_session_type": "client",
35 | "response_format": "FORMAT_2",
36 | "function_type": "list",
37 | "is_regional": "N",
38 | "pagination_support": "Y",
39 | "is_multi_account_support": "Y",
40 | "implclass": "_global_paginate",
41 | "implfunction": "process",
42 | "validation_functions": "",
43 | "pagination_attributes": [
44 | {
45 | "attribute_name": "analyzerArn",
46 | "attribute_value": "",
47 | "is_visible": "Y",
48 | "display_prompt": "The ARN of the analyzer to retrieve findings from",
49 | "type": "str"
50 | }
51 | ],
52 | "result_keys": [
53 | "findings"
54 | ],
55 | "json_response": {
56 | "id": "string",
57 | "principal_string": "string",
58 | "action_0": "string",
59 | "resource": "string",
60 | "isPublic": "string",
61 | "resourceType": "",
62 | "condition_string": "string",
63 | "createdAt": "",
64 | "analyzedAt": "",
65 | "updatedAt": "",
66 | "status": "",
67 | "resourceOwnerAccount": "string",
68 | "error": "string",
69 | "sources_0_type": "",
70 | "sources_0_detail_accessPointArn": "string",
71 | "sources_0_detail_accessPointAccount": "string"
72 | }
73 | },
74 | {
75 | "function_name": "list_findings_v2",
76 | "function_description": "list_findings_v2",
77 | "response_format": "FORMAT_2",
78 | "function_type": "list",
79 | "is_regional": "N",
80 | "pagination_support": "Y",
81 | "implclass": "_global_paginate",
82 | "implfunction": "process",
83 | "validation_functions": "",
84 | "is_multi_account_support": "Y",
85 | "boto_session_type": "client",
86 | "pagination_attributes": [
87 | {
88 | "attribute_name": "analyzerArn",
89 | "attribute_value": "",
90 | "is_visible": "Y",
91 | "display_prompt": "The ARN of the analyzer to retrieve findings from",
92 | "type": "str"
93 | }
94 | ],
95 | "result_keys": [
96 | "analyzers"
97 | ],
98 | "json_response": {
99 | "arn": "",
100 | "name": "",
101 | "type": "",
102 | "createdAt": "",
103 | "lastResourceAnalyzed": "",
104 | "lastResourceAnalyzedAt": "",
105 | "tags_string": "string",
106 | "status": "",
107 | "statusReason_code": "",
108 | "configuration_unusedAccess_unusedAccessAge": ""
109 | }
110 | }
111 | ]
112 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/account.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "account",
3 | "functions": [
4 | {
5 | "function_name": "list_regions",
6 | "function_description": "list_regions",
7 | "response_format": "FORMAT_2",
8 | "function_type": "list",
9 | "is_regional": "Y",
10 | "pagination_support": "Y",
11 | "implclass": "_regional_paginate",
12 | "implfunction": "process",
13 | "validation_functions": "",
14 | "is_multi_account_support": "Y",
15 | "boto_session_type": "client",
16 | "result_keys": [
17 | "Regions"
18 | ],
19 | "json_response": {
20 | "RegionName": "",
21 | "RegionOptStatus": ""
22 | }
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/acm.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "acm",
3 | "functions": [
4 | {
5 | "function_name": "list_certificates",
6 | "function_description": "Retrieves a list of certificate ARNs and domain names",
7 | "response_format": "FORMAT_2",
8 | "function_type": "list",
9 | "is_regional": "Y",
10 | "pagination_support": "N",
11 | "implclass": "_regional_no_paginate",
12 | "implfunction": "process",
13 | "validation_functions": "",
14 | "is_multi_account_support": "Y",
15 | "boto_session_type": "client",
16 | "result_keys": [
17 | "CertificateSummaryList"
18 | ],
19 | "json_response": {
20 | "CertificateArn": "string",
21 | "DomainName": "string",
22 | "SubjectAlternativeNameSummaries_0": "String",
23 | "HasAdditionalSubjectAlternativeNames": "",
24 | "Status": "",
25 | "Type": "",
26 | "KeyAlgorithm": "",
27 | "KeyUsages_0": "",
28 | "ExtendedKeyUsages_0": "",
29 | "InUse": "",
30 | "Exported": "",
31 | "RenewalEligibility": "",
32 | "NotBefore": "",
33 | "NotAfter": "",
34 | "CreatedAt": "",
35 | "IssuedAt": "",
36 | "ImportedAt": "",
37 | "RevokedAt": ""
38 | }
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/amp.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "amp",
3 | "functions": [
4 | {
5 | "function_name": "list_scrapers",
6 | "function_description": "PrometheusService :The ListScrapers operation lists all of the scrapers in your account",
7 | "response_format": "FORMAT_2",
8 | "function_type": "list",
9 | "is_regional": "Y",
10 | "pagination_support": "Y",
11 | "implclass": "_regional_paginate",
12 | "implfunction": "process",
13 | "validation_functions": "",
14 | "is_multi_account_support": "Y",
15 | "boto_session_type": "client",
16 | "result_keys": [
17 | "scrapers"
18 | ],
19 | "json_response": {
20 | "alias": "string",
21 | "arn": "string",
22 | "createdAt": "",
23 | "destination_ampConfiguration_workspaceArn": "string",
24 | "lastModifiedAt": "",
25 | "roleArn": "",
26 | "scraperId": "",
27 | "source_eksConfiguration_clusterArn": "",
28 | "source_eksConfiguration_securityGroupIds_0": "",
29 | "source_eksConfiguration_subnetIds_0": "",
30 | "status_statusCode": "",
31 | "statusReason": "",
32 | "tags_string": ""
33 | }
34 | },
35 | {
36 | "function_name": "list_workspaces",
37 | "function_description": "Lists all of the Amazon Managed Service for Prometheus workspaces in your account",
38 | "response_format": "FORMAT_2",
39 | "function_type": "list",
40 | "is_regional": "Y",
41 | "pagination_support": "Y",
42 | "implclass": "_regional_paginate",
43 | "implfunction": "process",
44 | "validation_functions": "",
45 | "is_multi_account_support": "Y",
46 | "boto_session_type": "client",
47 | "result_keys": [
48 | "workspaces"
49 | ],
50 | "json_response": {
51 | "alias": "string",
52 | "arn": "string",
53 | "createdAt": "",
54 | "kmsKeyArn": "string",
55 | "status_statusCode": "",
56 | "tags_string": "string",
57 | "workspaceId": "string"
58 | }
59 | }
60 | ]
61 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/apigateway.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "apigateway",
3 | "functions": [
4 | {
5 | "function_name": "get_rest_apis",
6 | "function_description": "List All Rest APIs",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "items"
18 | ],
19 | "json_response": {
20 | "id": "required",
21 | "name": "required",
22 | "description": "",
23 | "createdDate": "",
24 | "version": "",
25 | "warnings_0": "",
26 | "binaryMediaTypes_0": "",
27 | "minimumCompressionSize": "",
28 | "apiKeySource": "",
29 | "endpointConfiguration_types_0": "",
30 | "endpointConfiguration_vpcEndpointIds_0": "",
31 | "policy": "",
32 | "tags_string": "",
33 | "disableExecuteApiEndpoint": ""
34 | }
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/budgets.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "budgets",
3 | "functions": [
4 | {
5 | "function_name": "describe_budgets",
6 | "function_description": "Lists all the buedgets",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "N",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_global_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "pagination_attributes": [
17 | {
18 | "attribute_name": "AccountId",
19 | "attribute_value": "default",
20 | "is_visible": "N",
21 | "display_prompt": "",
22 | "type": "str"
23 | }
24 | ],
25 | "result_keys": [
26 | "Budgets"
27 | ],
28 | "json_response": {
29 | "BudgetName": "string",
30 | "BudgetLimit_Amount": "string",
31 | "BudgetLimit_Unit": "string",
32 | "PlannedBudgetLimits_string_Amount": "string",
33 | "PlannedBudgetLimits_string_Unit": "string",
34 | "CostFilters_string_0": "string",
35 | "CostTypes_IncludeTax": "",
36 | "CostTypes_IncludeSubscription": "",
37 | "CostTypes_UseBlended": "",
38 | "CostTypes_IncludeRefund": "",
39 | "CostTypes_IncludeCredit": "",
40 | "CostTypes_IncludeUpfront": "",
41 | "CostTypes_IncludeRecurring": "",
42 | "CostTypes_IncludeOtherSubscription": "",
43 | "CostTypes_IncludeSupport": "",
44 | "CostTypes_IncludeDiscount": "",
45 | "CostTypes_UseAmortized": "",
46 | "TimeUnit": "",
47 | "TimePeriod_Start": "",
48 | "TimePeriod_End": "",
49 | "CalculatedSpend_ActualSpend_Amount": "string",
50 | "CalculatedSpend_ActualSpend_Unit": "string",
51 | "CalculatedSpend_ForecastedSpend_Amount": "string",
52 | "CalculatedSpend_ForecastedSpend_Unit": "string",
53 | "BudgetType": "",
54 | "LastUpdatedTime": "",
55 | "AutoAdjustData_AutoAdjustType": "",
56 | "AutoAdjustData_HistoricalOptions_BudgetAdjustmentPeriod": "",
57 | "AutoAdjustData_HistoricalOptions_LookBackAvailablePeriods": "",
58 | "AutoAdjustData_LastAutoAdjustTime": ""
59 | }
60 | }
61 | ]
62 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/cleanrooms.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "cleanrooms",
3 | "functions": [
4 | {
5 | "function_name": "list_collaborations",
6 | "function_description": "Lists collaborations the caller owns is active in or has been invited to.",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "collaborationList"
18 | ],
19 | "json_response": {
20 | "id": "string",
21 | "arn": "string",
22 | "name": "string",
23 | "creatorAccountId": "string",
24 | "creatorDisplayName": "string",
25 | "createTime": "",
26 | "updateTime": "",
27 | "memberStatus": "",
28 | "membershipId": "string",
29 | "membershipArn": "string"
30 | }
31 | }
32 | ]
33 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/cloudformation.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "cloudformation",
3 | "functions": [
4 | {
5 | "function_name": "list_stacks",
6 | "function_description": "List of Clouformation Stacks",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "StackSummaries"
18 | ],
19 | "json_response": {
20 | "StackId": "string",
21 | "StackName": "string",
22 | "TemplateDescription": "string",
23 | "CreationTime": "",
24 | "LastUpdatedTime": "",
25 | "DeletionTime": "",
26 | "StackStatus": "",
27 | "StackStatusReason": "",
28 | "ParentId": "",
29 | "RootId": "",
30 | "DriftInformation_StackDriftStatus": "",
31 | "DriftInformation_LastCheckTimestamp": ""
32 | }
33 | },
34 | {
35 | "function_name": "list_stack_sets",
36 | "function_description": "stack sets that are associated",
37 | "boto_session_type": "client",
38 | "response_format": "FORMAT_2",
39 | "function_type": "list",
40 | "is_regional": "Y",
41 | "pagination_support": "Y",
42 | "is_multi_account_support": "Y",
43 | "implclass": "_regional_paginate",
44 | "implfunction": "process",
45 | "validation_functions": "",
46 | "result_keys": [
47 | "Summaries"
48 | ],
49 | "json_response": {
50 | "StackSetName": "string",
51 | "StackSetId": "string",
52 | "Description": "string",
53 | "Status": "",
54 | "AutoDeployment_Enabled": "",
55 | "AutoDeployment_RetainStacksOnAccountRemoval": "",
56 | "PermissionModel": "",
57 | "DriftStatus": "",
58 | "LastDriftCheckTimestamp": "",
59 | "ManagedExecution_Active": ""
60 | }
61 | }
62 | ]
63 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/cloudfront.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "cloudfront",
3 | "functions": [
4 | {
5 | "function_name": "list_distributions",
6 | "function_description": "List CloudFront distributions",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "DistributionList",
18 | "Items"
19 | ],
20 | "json_response": {
21 | "Id": "string",
22 | "ARN": "string",
23 | "Status": "string",
24 | "LastModifiedTime": "",
25 | "DomainName": "string",
26 | "Aliases_Quantity": "",
27 | "Aliases_Items_0": "string",
28 | "Origins_Quantity": "",
29 | "Origins_Items_0_Id": "string",
30 | "Origins_Items_0_DomainName": "string",
31 | "Origins_Items_0_OriginPath": "string",
32 | "Origins_Items_0_CustomHeaders_Quantity": "",
33 | "Origins_Items_0_CustomHeaders_Items_0_HeaderName": "string",
34 | "Origins_Items_0_CustomHeaders_Items_0_HeaderValue": "string",
35 | "Origins_Items_0_S3OriginConfig_OriginAccessIdentity": "string",
36 | "Origins_Items_0_CustomOriginConfig_HTTPPort": "",
37 | "Origins_Items_0_CustomOriginConfig_HTTPSPort": "",
38 | "Origins_Items_0_CustomOriginConfig_OriginProtocolPolicy": "",
39 | "Origins_Items_0_CustomOriginConfig_OriginSslProtocols_Quantity": "",
40 | "Origins_Items_0_CustomOriginConfig_OriginSslProtocols_Items_0": "",
41 | "Origins_Items_0_CustomOriginConfig_OriginReadTimeout": "",
42 | "Origins_Items_0_CustomOriginConfig_OriginKeepaliveTimeout": "",
43 | "Origins_Items_0_ConnectionAttempts": "",
44 | "Origins_Items_0_ConnectionTimeout": "",
45 | "Origins_Items_0_OriginShield_Enabled": "",
46 | "Origins_Items_0_OriginShield_OriginShieldRegion": "string",
47 | "Origins_Items_0_OriginAccessControlId": "string",
48 | "OriginGroups_Quantity": "",
49 | "OriginGroups_Items_0_Id": "string",
50 | "OriginGroups_Items_0_FailoverCriteria_StatusCodes_Quantity": "",
51 | "OriginGroups_Items_0_FailoverCriteria_StatusCodes_Items_0": "",
52 | "OriginGroups_Items_0_Members_Quantity": "",
53 | "OriginGroups_Items_0_Members_Items_0_OriginId": "string",
54 | "DefaultCacheBehavior_TargetOriginId": "string",
55 | "DefaultCacheBehavior_TrustedSigners_Enabled": "",
56 | "DefaultCacheBehavior_TrustedSigners_Quantity": "",
57 | "DefaultCacheBehavior_TrustedSigners_Items_0": "string",
58 | "DefaultCacheBehavior_TrustedKeyGroups_Enabled": "",
59 | "DefaultCacheBehavior_TrustedKeyGroups_Quantity": "",
60 | "DefaultCacheBehavior_TrustedKeyGroups_Items_0": "string",
61 | "DefaultCacheBehavior_ViewerProtocolPolicy": "",
62 | "DefaultCacheBehavior_AllowedMethods_Quantity": "",
63 | "DefaultCacheBehavior_AllowedMethods_Items_0": "",
64 | "DefaultCacheBehavior_AllowedMethods_CachedMethods_Quantity": "",
65 | "DefaultCacheBehavior_AllowedMethods_CachedMethods_Items_0": "",
66 | "DefaultCacheBehavior_SmoothStreaming": "",
67 | "DefaultCacheBehavior_Compress": "",
68 | "DefaultCacheBehavior_LambdaFunctionAssociations_Quantity": "",
69 | "DefaultCacheBehavior_LambdaFunctionAssociations_Items_0_LambdaFunctionARN": "string",
70 | "DefaultCacheBehavior_LambdaFunctionAssociations_Items_0_EventType": "",
71 | "DefaultCacheBehavior_LambdaFunctionAssociations_Items_0_IncludeBody": "",
72 | "DefaultCacheBehavior_FunctionAssociations_Quantity": "",
73 | "DefaultCacheBehavior_FunctionAssociations_Items_0_FunctionARN": "string",
74 | "DefaultCacheBehavior_FunctionAssociations_Items_0_EventType": "",
75 | "DefaultCacheBehavior_FieldLevelEncryptionId": "string",
76 | "DefaultCacheBehavior_RealtimeLogConfigArn": "string",
77 | "DefaultCacheBehavior_CachePolicyId": "string",
78 | "DefaultCacheBehavior_OriginRequestPolicyId": "string",
79 | "DefaultCacheBehavior_ResponseHeadersPolicyId": "string",
80 | "DefaultCacheBehavior_ForwardedValues_QueryString": "",
81 | "DefaultCacheBehavior_ForwardedValues_Cookies_Forward": "",
82 | "DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames_Quantity": "",
83 | "DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames_Items_0": "string",
84 | "DefaultCacheBehavior_ForwardedValues_Headers_Quantity": "",
85 | "DefaultCacheBehavior_ForwardedValues_Headers_Items_0": "string",
86 | "DefaultCacheBehavior_ForwardedValues_QueryStringCacheKeys_Quantity": "",
87 | "DefaultCacheBehavior_ForwardedValues_QueryStringCacheKeys_Items_0": "string",
88 | "DefaultCacheBehavior_MinTTL": "",
89 | "DefaultCacheBehavior_DefaultTTL": "",
90 | "DefaultCacheBehavior_MaxTTL": "",
91 | "CacheBehaviors_Quantity": "",
92 | "CacheBehaviors_Items_0_PathPattern": "string",
93 | "CacheBehaviors_Items_0_TargetOriginId": "string",
94 | "CacheBehaviors_Items_0_TrustedSigners_Enabled": "",
95 | "CacheBehaviors_Items_0_TrustedSigners_Quantity": "",
96 | "CacheBehaviors_Items_0_TrustedSigners_Items_0": "string",
97 | "CacheBehaviors_Items_0_TrustedKeyGroups_Enabled": "",
98 | "CacheBehaviors_Items_0_TrustedKeyGroups_Quantity": "",
99 | "CacheBehaviors_Items_0_TrustedKeyGroups_Items_0": "string",
100 | "CacheBehaviors_Items_0_ViewerProtocolPolicy": "",
101 | "CacheBehaviors_Items_0_AllowedMethods_Quantity": "",
102 | "CacheBehaviors_Items_0_AllowedMethods_Items_0": "",
103 | "CacheBehaviors_Items_0_AllowedMethods_CachedMethods_Quantity": "",
104 | "CacheBehaviors_Items_0_AllowedMethods_CachedMethods_Items_0": "",
105 | "CacheBehaviors_Items_0_SmoothStreaming": "",
106 | "CacheBehaviors_Items_0_Compress": "",
107 | "CacheBehaviors_Items_0_LambdaFunctionAssociations_Quantity": "",
108 | "CacheBehaviors_Items_0_LambdaFunctionAssociations_Items_0_LambdaFunctionARN": "string",
109 | "CacheBehaviors_Items_0_LambdaFunctionAssociations_Items_0_EventType": "",
110 | "CacheBehaviors_Items_0_LambdaFunctionAssociations_Items_0_IncludeBody": "",
111 | "CacheBehaviors_Items_0_FunctionAssociations_Quantity": "",
112 | "CacheBehaviors_Items_0_FunctionAssociations_Items_0_FunctionARN": "string",
113 | "CacheBehaviors_Items_0_FunctionAssociations_Items_0_EventType": "",
114 | "CacheBehaviors_Items_0_FieldLevelEncryptionId": "string",
115 | "CacheBehaviors_Items_0_RealtimeLogConfigArn": "string",
116 | "CacheBehaviors_Items_0_CachePolicyId": "string",
117 | "CacheBehaviors_Items_0_OriginRequestPolicyId": "string",
118 | "CacheBehaviors_Items_0_ResponseHeadersPolicyId": "string",
119 | "CacheBehaviors_Items_0_ForwardedValues_QueryString": "",
120 | "CacheBehaviors_Items_0_ForwardedValues_Cookies_Forward": "",
121 | "CacheBehaviors_Items_0_ForwardedValues_Cookies_WhitelistedNames_Quantity": "",
122 | "CacheBehaviors_Items_0_ForwardedValues_Cookies_WhitelistedNames_Items_0": "string",
123 | "CacheBehaviors_Items_0_ForwardedValues_Headers_Quantity": "",
124 | "CacheBehaviors_Items_0_ForwardedValues_Headers_Items_0": "string",
125 | "CacheBehaviors_Items_0_ForwardedValues_QueryStringCacheKeys_Quantity": "",
126 | "CacheBehaviors_Items_0_ForwardedValues_QueryStringCacheKeys_Items_0": "string",
127 | "CacheBehaviors_Items_0_MinTTL": "",
128 | "CacheBehaviors_Items_0_DefaultTTL": "",
129 | "CacheBehaviors_Items_0_MaxTTL": "",
130 | "CustomErrorResponses_Quantity": "",
131 | "CustomErrorResponses_Items_0_ErrorCode": "",
132 | "CustomErrorResponses_Items_0_ResponsePagePath": "string",
133 | "CustomErrorResponses_Items_0_ResponseCode": "string",
134 | "CustomErrorResponses_Items_0_ErrorCachingMinTTL": "",
135 | "Comment": "string",
136 | "PriceClass": "",
137 | "Enabled": "",
138 | "ViewerCertificate_CloudFrontDefaultCertificate": "",
139 | "ViewerCertificate_IAMCertificateId": "string",
140 | "ViewerCertificate_ACMCertificateArn": "string",
141 | "ViewerCertificate_SSLSupportMethod": "",
142 | "ViewerCertificate_MinimumProtocolVersion": "",
143 | "ViewerCertificate_Certificate": "string",
144 | "ViewerCertificate_CertificateSource": "",
145 | "Restrictions_GeoRestriction_RestrictionType": "",
146 | "Restrictions_GeoRestriction_Quantity": "",
147 | "Restrictions_GeoRestriction_Items_0": "string",
148 | "WebACLId": "string",
149 | "HttpVersion": "",
150 | "IsIPV6Enabled": "",
151 | "AliasICPRecordals_0_CNAME": "string",
152 | "AliasICPRecordals_0_ICPRecordalStatus": "",
153 | "Staging": ""
154 | }
155 | },
156 | {
157 | "function_name": "list_functions",
158 | "function_description": "Gets a list of all CloudFront functions in your Amazon Web Services account",
159 | "boto_session_type": "client",
160 | "response_format": "FORMAT_2",
161 | "function_type": "list",
162 | "is_regional": "Y",
163 | "pagination_support": "N",
164 | "is_multi_account_support": "Y",
165 | "implclass": "_regional_no_paginate",
166 | "implfunction": "process",
167 | "validation_functions": "",
168 | "result_keys": [
169 | "FunctionList",
170 | "Items"
171 | ],
172 | "json_response": {
173 | "Name": "string",
174 | "Status": "string",
175 | "FunctionConfig_Comment": "string",
176 | "FunctionConfig_Runtime": "",
177 | "FunctionMetadata_FunctionARN": "string",
178 | "FunctionMetadata_Stage": "",
179 | "FunctionMetadata_CreatedTime": "",
180 | "FunctionMetadata_LastModifiedTime": ""
181 | }
182 | }
183 | ]
184 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/cloudtrail.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "cloudtrail",
3 | "functions": [
4 | {
5 | "function_name": "list_trails",
6 | "function_description": "Lists trails ",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Trails"
18 | ],
19 | "json_response": {
20 | "TrailARN": "string",
21 | "Name": "string",
22 | "HomeRegion": "string"
23 | }
24 | }
25 | ]
26 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/cloudwatch.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "cloudwatch",
3 | "functions": [
4 | {
5 | "function_name": "list_dashboards",
6 | "function_description": "List of the dashboards for your account ",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "DashboardEntries"
18 | ],
19 | "json_response": {
20 | "DashboardName": "string",
21 | "DashboardArn": "string",
22 | "LastModified": "string",
23 | "Size": "string"
24 | }
25 | },
26 | {
27 | "function_name": "list_metrics",
28 | "function_description": "List the specified metrics",
29 | "boto_session_type": "client",
30 | "response_format": "FORMAT_2",
31 | "function_type": "list",
32 | "is_regional": "Y",
33 | "pagination_support": "Y",
34 | "is_multi_account_support": "Y",
35 | "implclass": "_regional_paginate",
36 | "implfunction": "process",
37 | "validation_functions": "",
38 | "result_keys": [
39 | "Metrics"
40 | ],
41 | "json_response": {
42 | "Namespace": "string",
43 | "MetricName": "string",
44 | "Dimensions_0_Name": "string",
45 | "Dimensions_0_Value": "string"
46 | }
47 | }
48 | ]
49 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/codecommit.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "codecommit",
3 | "functions": [
4 | {
5 | "function_name": "list_repositories",
6 | "function_description": "Gets information about one or more repositories.",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "repositories"
18 | ],
19 | "json_response": {
20 | "repositoryName": "string",
21 | "repositoryId": "string"
22 | }
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/dynamodb.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "dynamodb",
3 | "functions": [
4 | {
5 | "function_name": "list_tables",
6 | "function_description": "Returns a list of tables",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_3",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "TableNames"
18 | ],
19 | "json_response": {
20 | "TableName": ""
21 | }
22 | }
23 | ]
24 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/ecs.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "ecs",
3 | "functions": [
4 | {
5 | "function_name": "list_clusters",
6 | "function_description": "List ECS Clusters",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_3",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "clusterArns"
18 | ],
19 | "json_response": {
20 | "clusterArns": ""
21 | }
22 | },
23 | {
24 | "function_name": "list_services",
25 | "function_description": "List ECS services",
26 | "boto_session_type": "client",
27 | "response_format": "FORMAT_3",
28 | "function_type": "list",
29 | "is_regional": "Y",
30 | "pagination_support": "Y",
31 | "is_multi_account_support": "Y",
32 | "implclass": "_regional_paginate",
33 | "implfunction": "process",
34 | "validation_functions": "",
35 | "pagination_attributes": [
36 | {
37 | "attribute_name": "cluster",
38 | "attribute_value": "",
39 | "is_visible": "Y",
40 | "display_prompt": "The short name or full Amazon Resource Name (ARN) of the cluster ",
41 | "type": "str"
42 | }
43 | ],
44 | "result_keys": [
45 | "serviceArns"
46 | ],
47 | "json_response": {
48 | "ServiceArn": ""
49 | }
50 | },
51 | {
52 | "function_name": "list_tasks",
53 | "function_description": "list_tasks",
54 | "response_format": "FORMAT_3",
55 | "function_type": "list",
56 | "is_regional": "Y",
57 | "pagination_support": "N",
58 | "implclass": "_regional_paginate",
59 | "implfunction": "process",
60 | "validation_functions": "",
61 | "is_multi_account_support": "Y",
62 | "boto_session_type": "client",
63 | "pagination_attributes": [
64 | {
65 | "attribute_name": "cluster",
66 | "attribute_value": "default",
67 | "is_visible": "Y",
68 | "display_prompt": "The short name or full Amazon Resource Name (ARN) of the cluster",
69 | "type": "str"
70 | }
71 | ],
72 | "result_keys": [
73 | "taskArns"
74 | ],
75 | "json_response": {
76 | "taskArns": ""
77 | }
78 | }
79 | ]
80 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/efs.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "efs",
3 | "functions": [
4 | {
5 | "function_name": "describe_file_systems",
6 | "function_description": "Returns the description of a specific Amazon EFS file system ",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "FileSystems"
18 | ],
19 | "json_response": {
20 | "OwnerId": "string",
21 | "CreationToken": "string",
22 | "FileSystemId": "string",
23 | "FileSystemArn": "string",
24 | "CreationTime": "",
25 | "LifeCycleState": "",
26 | "Name": "string",
27 | "NumberOfMountTargets": "",
28 | "SizeInBytes_Value": "",
29 | "SizeInBytes_Timestamp": "",
30 | "SizeInBytes_ValueInIA": "",
31 | "SizeInBytes_ValueInStandard": "",
32 | "PerformanceMode": "",
33 | "Encrypted": "",
34 | "KmsKeyId": "string",
35 | "ThroughputMode": "",
36 | "ProvisionedThroughputInMibps": "",
37 | "AvailabilityZoneName": "string",
38 | "AvailabilityZoneId": "string",
39 | "Tags_0_Key": "string",
40 | "Tags_0_Value": "string"
41 | }
42 | }
43 | ]
44 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/eks.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "eks",
3 | "functions": [
4 | {
5 | "function_name": "describe_cluster",
6 | "function_description": "List EKS Clusters",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_1",
9 | "function_type": "object",
10 | "is_regional": "Y",
11 | "pagination_support": "N",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_no_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "pagination_attributes": [
17 | {
18 | "attribute_name": "name",
19 | "attribute_value": "",
20 | "is_visible": "Y",
21 | "display_prompt": "Name of EKS Cluster ",
22 | "type": "str"
23 | }
24 | ],
25 | "result_keys": [
26 | "cluster"
27 | ],
28 | "json_response": {
29 | "name": "string",
30 | "arn": "string",
31 | "createdAt": "",
32 | "version": "string",
33 | "endpoint": "string",
34 | "roleArn": "string",
35 | "resourcesVpcConfig_subnetIds_0": "string",
36 | "resourcesVpcConfig_securityGroupIds_0": "string",
37 | "resourcesVpcConfig_clusterSecurityGroupId": "string",
38 | "resourcesVpcConfig_vpcId": "string",
39 | "resourcesVpcConfig_endpointPublicAccess": "",
40 | "resourcesVpcConfig_endpointPrivateAccess": "",
41 | "resourcesVpcConfig_publicAccessCidrs_0": "string",
42 | "kubernetesNetworkConfig_serviceIpv4Cidr": "string",
43 | "kubernetesNetworkConfig_serviceIpv6Cidr": "string",
44 | "kubernetesNetworkConfig_ipFamily": "",
45 | "logging_clusterLogging_0_types_0": "",
46 | "logging_clusterLogging_0_enabled": "",
47 | "identity_oidc_issuer": "string",
48 | "status": "",
49 | "certificateAuthority_data": "string",
50 | "clientRequestToken": "string",
51 | "platformVersion": "string",
52 | "tags_string": "string",
53 | "encryptionConfig_0_resources_0": "string",
54 | "encryptionConfig_0_provider_keyArn": "string",
55 | "connectorConfig_activationId": "string",
56 | "connectorConfig_activationCode": "string",
57 | "connectorConfig_activationExpiry": "",
58 | "connectorConfig_provider": "string",
59 | "connectorConfig_roleArn": "string",
60 | "id": "string",
61 | "health_issues_0_code": "",
62 | "health_issues_0_message": "string",
63 | "health_issues_0_resourceIds_0": "string",
64 | "outpostConfig_outpostArns_0": "string",
65 | "outpostConfig_controlPlaneInstanceType": "string",
66 | "outpostConfig_controlPlanePlacement_groupName": "string"
67 | }
68 | },
69 | {
70 | "function_name": "list_clusters",
71 | "function_description": "List EKS Clusters",
72 | "boto_session_type": "client",
73 | "response_format": "FORMAT_3",
74 | "function_type": "list",
75 | "is_regional": "Y",
76 | "pagination_support": "Y",
77 | "is_multi_account_support": "Y",
78 | "implclass": "_regional_paginate",
79 | "implfunction": "process",
80 | "validation_functions": "",
81 | "result_keys": [
82 | "clusters"
83 | ],
84 | "json_response": {
85 | "cluster": ""
86 | }
87 | },
88 | {
89 | "function_name": "list_fargate_profiles",
90 | "function_description": "List Farget profiles",
91 | "boto_session_type": "client",
92 | "response_format": "FORMAT_3",
93 | "function_type": "list",
94 | "is_regional": "Y",
95 | "pagination_support": "Y",
96 | "is_multi_account_support": "Y",
97 | "implclass": "_regional_paginate",
98 | "implfunction": "process",
99 | "validation_functions": "",
100 | "pagination_attributes": [
101 | {
102 | "attribute_name": "clusterName",
103 | "attribute_value": "",
104 | "is_visible": "Y",
105 | "display_prompt": "Name of EKS Cluster ",
106 | "type": "str"
107 | }
108 | ],
109 | "result_keys": [
110 | "fargateProfileNames"
111 | ],
112 | "json_response": {
113 | "fargateProfileName": ""
114 | }
115 | }
116 | ]
117 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/elasticache.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "elasticache",
3 | "functions": [
4 | {
5 | "function_name": "describe_cache_clusters",
6 | "function_description": "Provisioned cluster",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "CacheClusters"
18 | ],
19 | "json_response": {
20 | "CacheClusterId": "string",
21 | "ConfigurationEndpoint_Address": "string",
22 | "ConfigurationEndpoint_Port": "",
23 | "ClientDownloadLandingPage": "string",
24 | "CacheNodeType": "string",
25 | "Engine": "string",
26 | "EngineVersion": "string",
27 | "CacheClusterStatus": "string",
28 | "NumCacheNodes": "",
29 | "PreferredAvailabilityZone": "string",
30 | "PreferredOutpostArn": "string",
31 | "CacheClusterCreateTime": "",
32 | "PreferredMaintenanceWindow": "string",
33 | "PendingModifiedValues_NumCacheNodes": "",
34 | "PendingModifiedValues_CacheNodeIdsToRemove_0": "string",
35 | "PendingModifiedValues_EngineVersion": "string",
36 | "PendingModifiedValues_CacheNodeType": "string",
37 | "PendingModifiedValues_AuthTokenStatus": "",
38 | "PendingModifiedValues_LogDeliveryConfigurations_0_LogType": "",
39 | "PendingModifiedValues_LogDeliveryConfigurations_0_DestinationType": "",
40 | "PendingModifiedValues_LogDeliveryConfigurations_0_DestinationDetails_CloudWatchLogsDetails_LogGroup": "string",
41 | "PendingModifiedValues_LogDeliveryConfigurations_0_DestinationDetails_KinesisFirehoseDetails_DeliveryStream": "string",
42 | "PendingModifiedValues_LogDeliveryConfigurations_0_LogFormat": "",
43 | "PendingModifiedValues_TransitEncryptionEnabled": "",
44 | "PendingModifiedValues_TransitEncryptionMode": "",
45 | "NotificationConfiguration_TopicArn": "string",
46 | "NotificationConfiguration_TopicStatus": "string",
47 | "CacheSecurityGroups_0_CacheSecurityGroupName": "string",
48 | "CacheSecurityGroups_0_Status": "string",
49 | "CacheParameterGroup_CacheParameterGroupName": "string",
50 | "CacheParameterGroup_ParameterApplyStatus": "string",
51 | "CacheParameterGroup_CacheNodeIdsToReboot_0": "string",
52 | "CacheSubnetGroupName": "string",
53 | "CacheNodes_0_CacheNodeId": "string",
54 | "CacheNodes_0_CacheNodeStatus": "string",
55 | "CacheNodes_0_CacheNodeCreateTime": "",
56 | "CacheNodes_0_Endpoint_Address": "string",
57 | "CacheNodes_0_Endpoint_Port": "",
58 | "CacheNodes_0_ParameterGroupStatus": "string",
59 | "CacheNodes_0_SourceCacheNodeId": "string",
60 | "CacheNodes_0_CustomerAvailabilityZone": "string",
61 | "CacheNodes_0_CustomerOutpostArn": "string",
62 | "AutoMinorVersionUpgrade": "",
63 | "SecurityGroups_0_SecurityGroupId": "string",
64 | "SecurityGroups_0_Status": "string",
65 | "ReplicationGroupId": "string",
66 | "SnapshotRetentionLimit": "",
67 | "SnapshotWindow": "string",
68 | "AuthTokenEnabled": "",
69 | "AuthTokenLastModifiedDate": "",
70 | "TransitEncryptionEnabled": "",
71 | "AtRestEncryptionEnabled": "",
72 | "ARN": "string",
73 | "ReplicationGroupLogDeliveryEnabled": "",
74 | "LogDeliveryConfigurations_0_LogType": "",
75 | "LogDeliveryConfigurations_0_DestinationType": "",
76 | "LogDeliveryConfigurations_0_DestinationDetails_CloudWatchLogsDetails_LogGroup": "string",
77 | "LogDeliveryConfigurations_0_DestinationDetails_KinesisFirehoseDetails_DeliveryStream": "string",
78 | "LogDeliveryConfigurations_0_LogFormat": "",
79 | "LogDeliveryConfigurations_0_Status": "",
80 | "LogDeliveryConfigurations_0_Message": "string",
81 | "NetworkType": "",
82 | "IpDiscovery": "",
83 | "TransitEncryptionMode": ""
84 | }
85 | }
86 | ]
87 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/elbv2.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "elbv2",
3 | "functions": [
4 | {
5 | "function_name": "describe_load_balancers",
6 | "function_description": "All of your load balancers.",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "LoadBalancers"
18 | ],
19 | "json_response": {
20 | "LoadBalancerArn": "string",
21 | "DNSName": "string",
22 | "CanonicalHostedZoneId": "string",
23 | "CreatedTime": "",
24 | "LoadBalancerName": "string",
25 | "Scheme": "",
26 | "VpcId": "string",
27 | "State_Code": "",
28 | "State_Reason": "string",
29 | "Type": "",
30 | "AvailabilityZones_0_ZoneName": "string",
31 | "AvailabilityZones_0_SubnetId": "string",
32 | "AvailabilityZones_0_OutpostId": "string",
33 | "AvailabilityZones_0_LoadBalancerAddresses_0_IpAddress": "string",
34 | "AvailabilityZones_0_LoadBalancerAddresses_0_AllocationId": "string",
35 | "AvailabilityZones_0_LoadBalancerAddresses_0_PrivateIPv4Address": "string",
36 | "AvailabilityZones_0_LoadBalancerAddresses_0_IPv6Address": "string",
37 | "SecurityGroups_0": "string",
38 | "IpAddressType": "",
39 | "CustomerOwnedIpv4Pool": "string"
40 | }
41 | }
42 | ]
43 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/emr-serverless.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "emr-serverless",
3 | "functions": [
4 | {
5 | "function_name": "list_applications",
6 | "function_description": "Lists applications",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "applications"
18 | ],
19 | "json_response": {
20 | "id": "string",
21 | "name": "string",
22 | "arn": "string",
23 | "releaseLabel": "string",
24 | "type": "string",
25 | "state": "",
26 | "stateDetails": "string",
27 | "createdAt": "",
28 | "updatedAt": "",
29 | "architecture": ""
30 | }
31 | },
32 | {
33 | "function_name": "list_job_runs",
34 | "function_description": "Lists job runs",
35 | "boto_session_type": "client",
36 | "response_format": "FORMAT_2",
37 | "function_type": "list",
38 | "is_regional": "Y",
39 | "pagination_support": "Y",
40 | "is_multi_account_support": "Y",
41 | "implclass": "_regional_paginate",
42 | "implfunction": "process",
43 | "validation_functions": "",
44 | "pagination_attributes": [
45 | {
46 | "attribute_name": "applicationId",
47 | "attribute_value": "",
48 | "is_visible": "Y",
49 | "display_prompt": "The ID of the application for which to list the job run",
50 | "type": "str"
51 | }
52 | ],
53 | "result_keys": [
54 | "jobRuns"
55 | ],
56 | "json_response": {
57 | "applicationId": "string",
58 | "id": "string",
59 | "name": "string",
60 | "arn": "string",
61 | "createdBy": "string",
62 | "createdAt": "string",
63 | "updatedAt": "string",
64 | "executionRole": "string",
65 | "state": "",
66 | "stateDetails": "string",
67 | "releaseLabel": "string",
68 | "type": "string"
69 | }
70 | }
71 | ]
72 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/emr.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "emr",
3 | "functions": [
4 | {
5 | "function_name": "list_clusters",
6 | "function_description": "List Clusters",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Clusters"
18 | ],
19 | "json_response": {
20 | "Id": "string",
21 | "Name": "string",
22 | "Status_State": "",
23 | "Status_StateChangeReason_Code": "",
24 | "Status_StateChangeReason_Message": "string",
25 | "Status_Timeline_CreationDateTime": "",
26 | "Status_Timeline_ReadyDateTime": "",
27 | "Status_Timeline_EndDateTime": "",
28 | "NormalizedInstanceHours": "",
29 | "ClusterArn": "string",
30 | "OutpostArn": "string"
31 | }
32 | },
33 | {
34 | "function_name": "list_instance_fleets",
35 | "function_description": "List Instance fleets of EMR Cluster",
36 | "boto_session_type": "client",
37 | "response_format": "FORMAT_2",
38 | "function_type": "list",
39 | "is_regional": "Y",
40 | "pagination_support": "Y",
41 | "is_multi_account_support": "Y",
42 | "implclass": "_regional_paginate",
43 | "implfunction": "process",
44 | "validation_functions": "",
45 | "pagination_attributes": [
46 | {
47 | "attribute_name": "ClusterId",
48 | "attribute_value": "",
49 | "is_visible": "Y",
50 | "display_prompt": "Please enter the unique identifier of the cluster",
51 | "type": "str"
52 | }
53 | ],
54 | "result_keys": [
55 | "InstanceFleets"
56 | ],
57 | "json_response": {
58 | "Id": "string",
59 | "Name": "string",
60 | "Status_State": "",
61 | "Status_StateChangeReason_Code": "",
62 | "Status_StateChangeReason_Message": "",
63 | "Status_Timeline_CreationDateTime": "",
64 | "Status_Timeline_ReadyDateTime": "",
65 | "Status_Timeline_EndDateTime": "",
66 | "InstanceFleetType": "",
67 | "TargetOnDemandCapacity": "",
68 | "TargetSpotCapacity": "",
69 | "ProvisionedOnDemandCapacity": "",
70 | "ProvisionedSpotCapacity": "",
71 | "InstanceTypeSpecifications_0_InstanceType": "string",
72 | "InstanceTypeSpecifications_0_WeightedCapacity": "",
73 | "InstanceTypeSpecifications_0_BidPrice": "string",
74 | "InstanceTypeSpecifications_0_BidPriceAsPercentageOfOnDemandPrice": "",
75 | "InstanceTypeSpecifications_0_Configurations_0_Classification": "string",
76 | "InstanceTypeSpecifications_0_Configurations_0_Properties_string": "string",
77 | "InstanceTypeSpecifications_0_EbsBlockDevices_0_VolumeSpecification_VolumeType": "string",
78 | "InstanceTypeSpecifications_0_EbsBlockDevices_0_VolumeSpecification_Iops": "string",
79 | "InstanceTypeSpecifications_0_EbsBlockDevices_0_VolumeSpecification_SizeInGB": "string",
80 | "InstanceTypeSpecifications_0_EbsBlockDevices_0_VolumeSpecification_Throughput": "string",
81 | "InstanceTypeSpecifications_0_EbsBlockDevices_0_Device": "string",
82 | "InstanceTypeSpecifications_0_EbsOptimized": "string",
83 | "InstanceTypeSpecifications_0_CustomAmiId": "string",
84 | "LaunchSpecifications_SpotSpecification_TimeoutDurationMinutes": "string",
85 | "LaunchSpecifications_SpotSpecification_TimeoutAction": "",
86 | "LaunchSpecifications_SpotSpecification_BlockDurationMinutes": "string",
87 | "LaunchSpecifications_SpotSpecification_AllocationStrategy": "capacity-optimized",
88 | "LaunchSpecifications_OnDemandSpecification_AllocationStrategy": "lowest-price",
89 | "LaunchSpecifications_OnDemandSpecification_CapacityReservationOptions_UsageStrategy": "",
90 | "LaunchSpecifications_OnDemandSpecification_CapacityReservationOptions_CapacityReservationPreference": "",
91 | "LaunchSpecifications_OnDemandSpecification_CapacityReservationOptions_CapacityReservationResourceGroupArn": "string"
92 | }
93 | },
94 | {
95 | "function_name": "list_notebook_executions",
96 | "function_description": "List Notebook executions",
97 | "boto_session_type": "client",
98 | "response_format": "FORMAT_2",
99 | "function_type": "list",
100 | "is_regional": "Y",
101 | "pagination_support": "Y",
102 | "is_multi_account_support": "Y",
103 | "implclass": "_regional_paginate",
104 | "implfunction": "process",
105 | "validation_functions": "",
106 | "result_keys": [
107 | "NotebookExecutions"
108 | ],
109 | "json_response": {
110 | "NotebookExecutionId": "string",
111 | "EditorId": "string",
112 | "NotebookExecutionName": "string",
113 | "Status": "",
114 | "StartTime": "",
115 | "EndTime": ""
116 | }
117 | },
118 | {
119 | "function_name": "list_studios",
120 | "function_description": "List Studios",
121 | "boto_session_type": "client",
122 | "response_format": "FORMAT_2",
123 | "function_type": "list",
124 | "is_regional": "Y",
125 | "pagination_support": "Y",
126 | "is_multi_account_support": "Y",
127 | "implclass": "_regional_paginate",
128 | "implfunction": "process",
129 | "validation_functions": "",
130 | "result_keys": [
131 | "Studios"
132 | ],
133 | "json_response": {
134 | "StudioId": "string",
135 | "Name": "string",
136 | "VpcId": "string",
137 | "Description": "string",
138 | "Url": "string",
139 | "AuthMode": "",
140 | "CreationTime": ""
141 | }
142 | }
143 | ]
144 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/iam.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "iam",
3 | "functions": [
4 | {
5 | "function_name": "list_users",
6 | "function_description": "Lists the IAM users ",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "N",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_global_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Users"
18 | ],
19 | "json_response": {
20 | "Path": "string",
21 | "UserName": "string",
22 | "UserId": "string",
23 | "Arn": "string",
24 | "CreateDate": "string",
25 | "PasswordLastUsed": "string",
26 | "PermissionsBoundary_PermissionsBoundaryType": "PermissionsBoundaryPolicy",
27 | "PermissionsBoundary_PermissionsBoundaryArn": "string",
28 | "Tags_0_Key": "string",
29 | "Tags_0_Value": "string"
30 | }
31 | },
32 | {
33 | "function_name": "list_access_keys",
34 | "function_description": "Returns information about the access key IDs associated with the specified IAM user",
35 | "boto_session_type": "client",
36 | "response_format": "FORMAT_2",
37 | "function_type": "list",
38 | "is_regional": "N",
39 | "pagination_support": "Y",
40 | "is_multi_account_support": "Y",
41 | "implclass": "_global_paginate",
42 | "implfunction": "process",
43 | "validation_functions": "",
44 | "result_keys": [
45 | "AccessKeyMetadata"
46 | ],
47 | "json_response": {
48 | "UserName": "required",
49 | "AccessKeyId": "required",
50 | "Status": "required",
51 | "CreateDate": "required"
52 | }
53 | },
54 | {
55 | "function_name": "list_account_aliases",
56 | "function_description": "Lists the account alias associated with the Amazon Web Services account ",
57 | "boto_session_type": "client",
58 | "response_format": "FORMAT_3",
59 | "function_type": "list",
60 | "is_regional": "N",
61 | "pagination_support": "Y",
62 | "is_multi_account_support": "Y",
63 | "implclass": "_global_paginate",
64 | "implfunction": "process",
65 | "validation_functions": "",
66 | "result_keys": [
67 | "AccountAliases"
68 | ],
69 | "json_response": {
70 | "AccountAliase": ""
71 | }
72 | },
73 | {
74 | "function_name": "list_attached_group_policies",
75 | "function_description": "Lists all managed policies that are attached to the specified IAM group",
76 | "boto_session_type": "client",
77 | "response_format": "FORMAT_2",
78 | "function_type": "list",
79 | "is_regional": "N",
80 | "pagination_support": "Y",
81 | "is_multi_account_support": "Y",
82 | "implclass": "_global_paginate",
83 | "implfunction": "process",
84 | "validation_functions": "",
85 | "pagination_attributes": [
86 | {
87 | "attribute_name": "GroupName",
88 | "attribute_value": "",
89 | "is_visible": "Y",
90 | "display_prompt": "Group Name",
91 | "type": "str"
92 | }
93 | ],
94 | "result_keys": [
95 | "AttachedPolicies"
96 | ],
97 | "json_response": {
98 | "PolicyName": "required",
99 | "PolicyArn": "required"
100 | }
101 | },
102 | {
103 | "function_name": "list_attached_role_policies",
104 | "function_description": "Lists all managed policies that are attached to the specified IAM role",
105 | "boto_session_type": "client",
106 | "response_format": "FORMAT_2",
107 | "function_type": "list",
108 | "is_regional": "N",
109 | "pagination_support": "Y",
110 | "is_multi_account_support": "Y",
111 | "implclass": "_global_paginate",
112 | "implfunction": "process",
113 | "validation_functions": "",
114 | "pagination_attributes": [
115 | {
116 | "attribute_name": "RoleName",
117 | "attribute_value": "",
118 | "is_visible": "Y",
119 | "display_prompt": "Role Name",
120 | "type": "str"
121 | }
122 | ],
123 | "result_keys": [
124 | "AttachedPolicies"
125 | ],
126 | "json_response": {
127 | "PolicyName": "required",
128 | "PolicyArn": "required"
129 | }
130 | },
131 | {
132 | "function_name": "list_attached_user_policies",
133 | "function_description": "Lists all managed policies that are attached to the specified IAM role",
134 | "boto_session_type": "client",
135 | "response_format": "FORMAT_2",
136 | "function_type": "list",
137 | "is_regional": "N",
138 | "pagination_support": "Y",
139 | "is_multi_account_support": "Y",
140 | "implclass": "_global_paginate",
141 | "implfunction": "process",
142 | "validation_functions": "",
143 | "pagination_attributes": [
144 | {
145 | "attribute_name": "UserName",
146 | "attribute_value": "",
147 | "is_visible": "Y",
148 | "display_prompt": "User Name",
149 | "type": "str"
150 | }
151 | ],
152 | "result_keys": [
153 | "AttachedPolicies"
154 | ],
155 | "json_response": {
156 | "PolicyName": "required",
157 | "PolicyArn": "required"
158 | }
159 | },
160 | {
161 | "function_name": "list_group_policies",
162 | "function_description": "Lists all managed policies that are attached to the specified IAM role",
163 | "boto_session_type": "client",
164 | "response_format": "FORMAT_3",
165 | "function_type": "list",
166 | "is_regional": "N",
167 | "pagination_support": "Y",
168 | "is_multi_account_support": "Y",
169 | "implclass": "_global_paginate",
170 | "implfunction": "process",
171 | "pagination_attributes": [
172 | {
173 | "attribute_name": "GroupName",
174 | "attribute_value": "",
175 | "is_visible": "Y",
176 | "display_prompt": "Group Name",
177 | "type": "str"
178 | }
179 | ],
180 | "validation_functions": "",
181 | "result_keys": [
182 | "PolicyNames"
183 | ],
184 | "json_response": {
185 | "PolicyName": ""
186 | }
187 | },
188 | {
189 | "function_name": "list_groups",
190 | "function_description": "Lists all managed policies that are attached to the specified IAM role",
191 | "boto_session_type": "client",
192 | "response_format": "FORMAT_2",
193 | "function_type": "list",
194 | "is_regional": "N",
195 | "pagination_support": "Y",
196 | "is_multi_account_support": "Y",
197 | "implclass": "_global_paginate",
198 | "implfunction": "process",
199 | "validation_functions": "",
200 | "result_keys": [
201 | "Groups"
202 | ],
203 | "json_response": {
204 | "Path": "",
205 | "GroupName": "",
206 | "GroupId": "",
207 | "Arn": "",
208 | "CreateDate": ""
209 | }
210 | },
211 | {
212 | "function_name": "list_policies",
213 | "function_description": "List All the IAM Polices",
214 | "boto_session_type": "client",
215 | "response_format": "FORMAT_2",
216 | "function_type": "list",
217 | "is_regional": "N",
218 | "pagination_support": "Y",
219 | "is_multi_account_support": "Y",
220 | "implclass": "_global_paginate",
221 | "implfunction": "process",
222 | "validation_functions": "",
223 | "result_keys": [
224 | "Policies"
225 | ],
226 | "json_response": {
227 | "PolicyName": "required",
228 | "PolicyId": "required",
229 | "Arn": "required",
230 | "Path": "string",
231 | "DefaultVersionId": "string",
232 | "AttachmentCount": "string",
233 | "PermissionsBoundaryUsageCount": "string",
234 | "IsAttachable": "string",
235 | "Description": "string",
236 | "CreateDate": "required",
237 | "UpdateDate": "required",
238 | "Tags_0_Key": "string",
239 | "Tags_0_Value": "string"
240 | }
241 | },
242 | {
243 | "function_name": "list_roles",
244 | "function_description": "Roles",
245 | "boto_session_type": "client",
246 | "response_format": "FORMAT_2",
247 | "function_type": "list",
248 | "is_regional": "N",
249 | "pagination_support": "Y",
250 | "is_multi_account_support": "Y",
251 | "implclass": "_global_paginate",
252 | "implfunction": "process",
253 | "validation_functions": "",
254 | "result_keys": [
255 | "Roles"
256 | ],
257 | "json_response": {
258 | "Path": "string",
259 | "RoleName": "required",
260 | "RoleId": "required",
261 | "Arn": "required",
262 | "CreateDate": "string",
263 | "AssumeRolePolicyDocument": "string",
264 | "Description": "string",
265 | "MaxSessionDuration": "string",
266 | "PermissionsBoundary_PermissionsBoundaryType": "string",
267 | "PermissionsBoundary_PermissionsBoundaryArn": "string",
268 | "Tags_0_Key": "string",
269 | "Tags_0_Value": "string",
270 | "RoleLastUsed_LastUsedDate": "string",
271 | "RoleLastUsed_Region": "string"
272 | }
273 | }
274 | ]
275 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/kms.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "kms",
3 | "functions": [
4 | {
5 | "function_name": "list_keys",
6 | "function_description": "Gets a list of all KMS keys.",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Keys"
18 | ],
19 | "json_response": {
20 | "KeyId": "string",
21 | "KeyArn": "string"
22 | }
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/lambda.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "lambda",
3 | "functions": [
4 | {
5 | "function_name": "list_functions",
6 | "function_description": "List Lambda Functions",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Functions"
18 | ],
19 | "json_response": {
20 | "FunctionName": "required",
21 | "FunctionArn": "required",
22 | "Runtime": "string",
23 | "Role": "string",
24 | "Handler": "string",
25 | "CodeSize": "",
26 | "Description": "",
27 | "Timeout": "",
28 | "MemorySize": "",
29 | "LastModified": "",
30 | "CodeSha256": "",
31 | "Version": "",
32 | "VpcConfig_SubnetIds_0": "0",
33 | "VpcConfig_SecurityGroupIds_0": "0",
34 | "VpcConfig_VpcId": "string",
35 | "DeadLetterConfig_TargetArn": "0",
36 | "Environment_Variables_string": "0",
37 | "Environment_Error_ErrorCode": "",
38 | "Environment_Error_Message": "",
39 | "KMSKeyArn": "string",
40 | "TracingConfig_Mode": "",
41 | "MasterArn": "",
42 | "RevisionId": "",
43 | "Layers_0_Arn": "",
44 | "Layers_0_CodeSize": "",
45 | "Layers_0_SigningProfileVersionArn": "",
46 | "Layers_0_SigningJobArn": "",
47 | "State": "string",
48 | "StateReason": "string",
49 | "StateReasonCode": "",
50 | "LastUpdateStatus": "",
51 | "LastUpdateStatusReason": "",
52 | "LastUpdateStatusReasonCode": "",
53 | "FileSystemConfigs_0_Arn": "string",
54 | "FileSystemConfigs_0_LocalMountPath": "string",
55 | "PackageType": "",
56 | "ImageConfigResponse_ImageConfig_EntryPoint_0": "string",
57 | "ImageConfigResponse_ImageConfig_Command_0": "string",
58 | "ImageConfigResponse_ImageConfig_WorkingDirectory": "string",
59 | "ImageConfigResponse_Error_ErrorCode": "string",
60 | "ImageConfigResponse_Error_Message": "string",
61 | "SigningProfileVersionArn": "string",
62 | "SigningJobArn": "string",
63 | "Architectures_0": "",
64 | "EphemeralStorage_Size": ""
65 | }
66 | },
67 | {
68 | "function_name": "list_layers",
69 | "function_description": "List Layers",
70 | "boto_session_type": "client",
71 | "response_format": "FORMAT_2",
72 | "function_type": "list",
73 | "is_regional": "Y",
74 | "pagination_support": "Y",
75 | "is_multi_account_support": "Y",
76 | "implclass": "_regional_paginate",
77 | "implfunction": "process",
78 | "validation_functions": "",
79 | "result_keys": [
80 | "Layers"
81 | ],
82 | "json_response": {
83 | "LatestMatchingVersion_CompatibleRuntimes_0": "",
84 | "LatestMatchingVersion_CreatedDate": "",
85 | "LatestMatchingVersion_Description": "",
86 | "LatestMatchingVersion_LayerVersionArn": "",
87 | "LatestMatchingVersion_Version": "",
88 | "LayerArn": "required",
89 | "LayerName": "required"
90 | }
91 | }
92 | ]
93 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/organizations.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "organizations",
3 | "functions": [
4 | {
5 | "function_name": "list_accounts",
6 | "function_description": "List accounts in Organization",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "N",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "N",
13 | "implclass": "_global_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Accounts"
18 | ],
19 | "json_response": {
20 | "Id": "string",
21 | "Arn": "string",
22 | "Email": "string",
23 | "Name": "string",
24 | "Status": "",
25 | "JoinedMethod": "",
26 | "JoinedTimestamp": ""
27 | }
28 | },
29 | {
30 | "function_name": "list_policies",
31 | "function_description": "List Policies in Organization",
32 | "boto_session_type": "client",
33 | "response_format": "FORMAT_2",
34 | "function_type": "list",
35 | "is_regional": "N",
36 | "pagination_support": "Y",
37 | "is_multi_account_support": "N",
38 | "implclass": "_global_paginate",
39 | "implfunction": "process",
40 | "validation_functions": "",
41 | "pagination_attributes": [
42 | {
43 | "attribute_name": "Filter",
44 | "attribute_value": "SERVICE_CONTROL_POLICY",
45 | "is_visible": "N",
46 | "display_prompt": "",
47 | "type": "str"
48 | }
49 | ],
50 | "result_keys": [
51 | "Policies"
52 | ],
53 | "json_response": {
54 | "Id": "string",
55 | "Arn": "string",
56 | "Name": "string",
57 | "Description": "string",
58 | "Type": "",
59 | "AwsManaged": ""
60 | }
61 | }
62 | ]
63 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/redshift-serverless.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "redshift-serverless",
3 | "functions": [
4 | {
5 | "function_name": "list_namespaces",
6 | "function_description": "List Name spaces",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "namespaces"
18 | ],
19 | "json_response": {
20 | "adminUsername": "string",
21 | "creationDate": "string",
22 | "dbName": "string",
23 | "defaultIamRoleArn": "string",
24 | "iamRoles_0": "string",
25 | "kmsKeyId": "string",
26 | "logExports_0": "",
27 | "namespaceArn": "string",
28 | "namespaceId": "string",
29 | "namespaceName": "string",
30 | "status": ""
31 | }
32 | },
33 | {
34 | "function_name": "list_workgroups",
35 | "function_description": "List work groups",
36 | "boto_session_type": "client",
37 | "response_format": "FORMAT_2",
38 | "function_type": "list",
39 | "is_regional": "Y",
40 | "pagination_support": "Y",
41 | "is_multi_account_support": "Y",
42 | "implclass": "_regional_paginate",
43 | "implfunction": "process",
44 | "validation_functions": "",
45 | "result_keys": [
46 | "workgroups"
47 | ],
48 | "json_response": {
49 | "baseCapacity": "",
50 | "configParameters_0_parameterKey": "string",
51 | "configParameters_0_parameterValue": "string",
52 | "creationDate": "string",
53 | "endpoint_address": "string",
54 | "endpoint_port": "",
55 | "endpoint_vpcEndpoints_0_networkInterfaces_0_availabilityZone": "string",
56 | "endpoint_vpcEndpoints_0_networkInterfaces_0_networkInterfaceId": "string",
57 | "endpoint_vpcEndpoints_0_networkInterfaces_0_privateIpAddress": "string",
58 | "endpoint_vpcEndpoints_0_networkInterfaces_0_subnetId": "string",
59 | "endpoint_vpcEndpoints_0_vpcEndpointId": "string",
60 | "endpoint_vpcEndpoints_0_vpcId": "string",
61 | "enhancedVpcRouting": "string",
62 | "namespaceName": "string",
63 | "port": "",
64 | "publiclyAccessible": "string",
65 | "securityGroupIds_0": "string",
66 | "status": "",
67 | "subnetIds_0": "string",
68 | "workgroupArn": "string",
69 | "workgroupId": "string",
70 | "workgroupName": "string"
71 | }
72 | }
73 | ]
74 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/redshift.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "redshift",
3 | "functions": [
4 | {
5 | "function_name": "describe_clusters",
6 | "function_description": "Amazon Redshift returns all clusters ",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Clusters"
18 | ],
19 | "json_response": {
20 | "ClusterIdentifier": "string",
21 | "NodeType": "string",
22 | "ClusterStatus": "string",
23 | "ClusterAvailabilityStatus": "string",
24 | "ModifyStatus": "string",
25 | "MasterUsername": "string",
26 | "DBName": "string",
27 | "Endpoint_Address": "string",
28 | "Endpoint_Port": "string",
29 | "Endpoint_VpcEndpoints_0_VpcEndpointId": "string",
30 | "Endpoint_VpcEndpoints_0_VpcId": "string",
31 | "Endpoint_VpcEndpoints_0_NetworkInterfaces_0_NetworkInterfaceId": "string",
32 | "Endpoint_VpcEndpoints_0_NetworkInterfaces_0_SubnetId": "string",
33 | "Endpoint_VpcEndpoints_0_NetworkInterfaces_0_PrivateIpAddress": "string",
34 | "Endpoint_VpcEndpoints_0_NetworkInterfaces_0_AvailabilityZone": "string",
35 | "ClusterCreateTime": "string",
36 | "AutomatedSnapshotRetentionPeriod": "string",
37 | "ManualSnapshotRetentionPeriod": "string",
38 | "ClusterSecurityGroups_0_ClusterSecurityGroupName": "string",
39 | "ClusterSecurityGroups_0_Status": "string",
40 | "VpcSecurityGroups_0_VpcSecurityGroupId": "string",
41 | "VpcSecurityGroups_0_Status": "string",
42 | "ClusterParameterGroups_0_ParameterGroupName": "string",
43 | "ClusterParameterGroups_0_ParameterApplyStatus": "string",
44 | "ClusterParameterGroups_0_ClusterParameterStatusList_0_ParameterName": "string",
45 | "ClusterParameterGroups_0_ClusterParameterStatusList_0_ParameterApplyStatus": "string",
46 | "ClusterParameterGroups_0_ClusterParameterStatusList_0_ParameterApplyErrorDescription": "string",
47 | "ClusterSubnetGroupName": "string",
48 | "VpcId": "string",
49 | "AvailabilityZone": "string",
50 | "PreferredMaintenanceWindow": "string",
51 | "PendingModifiedValues_MasterUserPassword": "string",
52 | "PendingModifiedValues_NodeType": "string",
53 | "PendingModifiedValues_NumberOfNodes": "String ",
54 | "PendingModifiedValues_ClusterType": "string",
55 | "PendingModifiedValues_ClusterVersion": "string",
56 | "PendingModifiedValues_AutomatedSnapshotRetentionPeriod": "String ",
57 | "PendingModifiedValues_ClusterIdentifier": "string",
58 | "PendingModifiedValues_PubliclyAccessible": "string",
59 | "PendingModifiedValues_EnhancedVpcRouting": "string",
60 | "PendingModifiedValues_MaintenanceTrackName": "string",
61 | "PendingModifiedValues_EncryptionType": "string",
62 | "ClusterVersion": "string",
63 | "AllowVersionUpgrade": "string",
64 | "NumberOfNodes": "string",
65 | "PubliclyAccessible": "string",
66 | "Encrypted": "string",
67 | "RestoreStatus_Status": "string",
68 | "RestoreStatus_CurrentRestoreRateInMegaBytesPerSecond": "string",
69 | "RestoreStatus_SnapshotSizeInMegaBytes": "string",
70 | "RestoreStatus_ProgressInMegaBytes": "string",
71 | "RestoreStatus_ElapsedTimeInSeconds": "string",
72 | "RestoreStatus_EstimatedTimeToCompletionInSeconds": "string",
73 | "DataTransferProgress_Status": "string",
74 | "DataTransferProgress_CurrentRateInMegaBytesPerSecond": "String ",
75 | "DataTransferProgress_TotalDataInMegaBytes": "String ",
76 | "DataTransferProgress_DataTransferredInMegaBytes": "String ",
77 | "DataTransferProgress_EstimatedTimeToCompletionInSeconds": "String ",
78 | "DataTransferProgress_ElapsedTimeInSeconds": "String ",
79 | "HsmStatus_HsmClientCertificateIdentifier": "string",
80 | "HsmStatus_HsmConfigurationIdentifier": "string",
81 | "HsmStatus_Status": "string",
82 | "ClusterSnapshotCopyStatus_DestinationRegion": "string",
83 | "ClusterSnapshotCopyStatus_RetentionPeriod": "String ",
84 | "ClusterSnapshotCopyStatus_ManualSnapshotRetentionPeriod": "String ",
85 | "ClusterSnapshotCopyStatus_SnapshotCopyGrantName": "string",
86 | "ClusterPublicKey": "string",
87 | "ClusterNodes_0_NodeRole": "string",
88 | "ClusterNodes_0_PrivateIPAddress": "string",
89 | "ClusterNodes_0_PublicIPAddress": "string",
90 | "ElasticIpStatus_ElasticIp": "string",
91 | "ElasticIpStatus_Status": "string",
92 | "ClusterRevisionNumber": "string",
93 | "Tags_0_Key": "string",
94 | "Tags_0_Value": "string",
95 | "KmsKeyId": "string",
96 | "EnhancedVpcRouting": "",
97 | "IamRoles_0_IamRoleArn": "string",
98 | "IamRoles_0_ApplyStatus": "string",
99 | "PendingActions_0": "string",
100 | "MaintenanceTrackName": "string",
101 | "ElasticResizeNumberOfNodeOptions": "string",
102 | "DeferredMaintenanceWindows_0_DeferMaintenanceIdentifier": "string",
103 | "DeferredMaintenanceWindows_0_DeferMaintenanceStartTime": "string",
104 | "DeferredMaintenanceWindows_0_DeferMaintenanceEndTime": "string",
105 | "SnapshotScheduleIdentifier": "string",
106 | "SnapshotScheduleState": "",
107 | "ExpectedNextSnapshotScheduleTime": "string",
108 | "ExpectedNextSnapshotScheduleTimeStatus": "string",
109 | "NextMaintenanceWindowStartTime": "string",
110 | "ResizeInfo_ResizeType": "string",
111 | "ResizeInfo_AllowCancelResize": "string",
112 | "AvailabilityZoneRelocationStatus": "string",
113 | "ClusterNamespaceArn": "string",
114 | "TotalStorageCapacityInMegaBytes": "String ",
115 | "AquaConfiguration_AquaStatus": "",
116 | "AquaConfiguration_AquaConfigurationStatus": "",
117 | "DefaultIamRoleArn": "string",
118 | "ReservedNodeExchangeStatus_ReservedNodeExchangeRequestId": "string",
119 | "ReservedNodeExchangeStatus_Status": "",
120 | "ReservedNodeExchangeStatus_RequestTime": "string",
121 | "ReservedNodeExchangeStatus_SourceReservedNodeId": "string",
122 | "ReservedNodeExchangeStatus_SourceReservedNodeType": "string",
123 | "ReservedNodeExchangeStatus_SourceReservedNodeCount": "String ",
124 | "ReservedNodeExchangeStatus_TargetReservedNodeOfferingId": "string",
125 | "ReservedNodeExchangeStatus_TargetReservedNodeType": "string",
126 | "ReservedNodeExchangeStatus_TargetReservedNodeCount": "String "
127 | }
128 | }
129 | ]
130 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/resourcegroupstaggingapi.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "resourcegroupstaggingapi",
3 | "functions": [
4 | {
5 | "function_name": "get_resources",
6 | "function_description": "Resources",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "pagination_attributes": [
16 | {
17 | "attribute_name": "Key",
18 | "attribute_value": "",
19 | "is_visible": "Y",
20 | "display_prompt": "Enter the Tag name",
21 | "type": "list",
22 | "parent_key": "TagFilters"
23 | }
24 | ],
25 | "validation_functions": "",
26 | "result_keys": [
27 | "ResourceTagMappingList"
28 | ],
29 | "json_response": {
30 | "ResourceARN": "",
31 | "Tags_0_Key": "",
32 | "Tags_0_Value": "",
33 | "ComplianceDetails_NoncompliantKeys_0": "",
34 | "ComplianceDetails_KeysWithNoncompliantValues_0": "",
35 | "ComplianceDetails_ComplianceStatus": ""
36 | }
37 | }
38 | ]
39 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/route53.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "route53",
3 | "functions": [
4 | {
5 | "function_name": "list_cidr_blocks",
6 | "function_description": "Returns a paginated list of CIDR collections in the Amazon Web Services account (metadata only)",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "N",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_global_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "pagination_attributes": [
17 | {
18 | "attribute_name": "CollectionId",
19 | "attribute_value": "",
20 | "is_visible": "Y",
21 | "display_prompt": "CollectionId The UUID of the CIDR collection.",
22 | "type": "str"
23 | }
24 | ],
25 | "result_keys": [
26 | "CidrCollections"
27 | ],
28 | "json_response": {
29 | "Arn": "string",
30 | "Id": "string",
31 | "Name": "string",
32 | "Version": ""
33 | }
34 | },
35 | {
36 | "function_name": "list_hosted_zones",
37 | "function_description": "Retrieves a list of the public and private hosted zones that are associated with the current Amazon Web Services account",
38 | "boto_session_type": "client",
39 | "response_format": "FORMAT_2",
40 | "function_type": "list",
41 | "is_regional": "N",
42 | "pagination_support": "Y",
43 | "is_multi_account_support": "Y",
44 | "implclass": "_global_no_paginate",
45 | "implfunction": "process",
46 | "validation_functions": "",
47 | "result_keys": [
48 | "HostedZones"
49 | ],
50 | "json_response": {
51 | "Id": "string",
52 | "Name": "string",
53 | "CallerReference": "string",
54 | "Config_Comment": "string",
55 | "Config_PrivateZone": "",
56 | "ResourceRecordSetCount": "",
57 | "LinkedService_ServicePrincipal": "string",
58 | "LinkedService_Description": "string"
59 | }
60 | },
61 | {
62 | "function_name": "list_hosted_zones_by_vpc",
63 | "function_description": "Retrieves a list of the public and private hosted zones that are associated with the current Amazon Web Services account",
64 | "boto_session_type": "client",
65 | "response_format": "FORMAT_2",
66 | "function_type": "list",
67 | "is_regional": "N",
68 | "pagination_support": "Y",
69 | "is_multi_account_support": "N",
70 | "implclass": "_global_no_paginate",
71 | "implfunction": "process",
72 | "validation_functions": "",
73 | "pagination_attributes": [
74 | {
75 | "attribute_name": "VPCId",
76 | "attribute_value": "",
77 | "is_visible": "Y",
78 | "display_prompt": "The ID of the Amazon VPC that you want to list hosted zones",
79 | "type": "str"
80 | },
81 | {
82 | "attribute_name": "VPCRegion",
83 | "attribute_value": "",
84 | "is_visible": "Y",
85 | "display_prompt": "The Amazon Web Services Region that you created the VPC in.",
86 | "type": "str"
87 | }
88 | ],
89 | "result_keys": [
90 | "HostedZoneSummaries"
91 | ],
92 | "json_response": {
93 | "HostedZoneId": "string",
94 | "Name": "string",
95 | "Owner_OwningAccount": "string",
96 | "Owner_OwningService": "string"
97 | }
98 | },
99 | {
100 | "function_name": "list_vpc_association_authorizations",
101 | "function_description": "Gets a list of the VPCs that were created by other accounts and that can be associated with a specified hosted zone because youve submitted one or more CreateVPCAssociationAuthorization requests.",
102 | "boto_session_type": "client",
103 | "response_format": "FORMAT_2",
104 | "function_type": "list",
105 | "is_regional": "N",
106 | "pagination_support": "Y",
107 | "is_multi_account_support": "Y",
108 | "implclass": "_global_paginate",
109 | "implfunction": "process",
110 | "validation_functions": "",
111 | "pagination_attributes": [
112 | {
113 | "attribute_name": "HostedZoneId",
114 | "attribute_value": "",
115 | "is_visible": "Y",
116 | "display_prompt": "Hosted Zone Id",
117 | "type": "str"
118 | }
119 | ],
120 | "result_keys": [
121 | "VPCs"
122 | ],
123 | "json_response": {
124 | "VPCRegion": "",
125 | "VPCId": "string"
126 | }
127 | }
128 | ]
129 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/route53domains.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "route53domains",
3 | "functions": [
4 | {
5 | "function_name": "list_domains",
6 | "function_description": "Domain names registered with Amazon Route 53 ",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "N",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_global_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Domains"
18 | ],
19 | "json_response": {
20 | "DomainName": "string",
21 | "AutoRenew": "string",
22 | "TransferLock": "string",
23 | "Expiry": "string"
24 | }
25 | },
26 | {
27 | "function_name": "list_prices",
28 | "function_description": "Lists the following prices for either all the TLDs supported by Route 53",
29 | "boto_session_type": "client",
30 | "response_format": "FORMAT_2",
31 | "function_type": "list",
32 | "is_regional": "N",
33 | "pagination_support": "Y",
34 | "is_multi_account_support": "Y",
35 | "implclass": "_global_paginate",
36 | "implfunction": "process",
37 | "validation_functions": "",
38 | "result_keys": [
39 | "Prices"
40 | ],
41 | "json_response": {
42 | "Name": "string",
43 | "RegistrationPrice_Price": "",
44 | "RegistrationPrice_Currency": "string",
45 | "TransferPrice_Price": "",
46 | "TransferPrice_Currency": "string",
47 | "RenewalPrice_Price": "",
48 | "RenewalPrice_Currency": "string",
49 | "ChangeOwnershipPrice_Price": "",
50 | "ChangeOwnershipPrice_Currency": "string",
51 | "RestorationPrice_Price": "",
52 | "RestorationPrice_Currency": "string"
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/s3.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "s3",
3 | "functions": [
4 | {
5 | "function_name": "list_bucket_analytics_configurations",
6 | "function_description": "Lists the analytics configurations for the bucket",
7 | "response_format": "FORMAT_2",
8 | "function_type": "list",
9 | "is_regional": "N",
10 | "pagination_support": "N",
11 | "implclass": "_global_no_paginate",
12 | "implfunction": "process",
13 | "validation_functions": "",
14 | "is_multi_account_support": "Y",
15 | "boto_session_type": "client",
16 | "pagination_attributes": [
17 | {
18 | "attribute_name": "Bucket",
19 | "attribute_value": "",
20 | "is_visible": "Y",
21 | "display_prompt": "The name of the bucket",
22 | "type": "str"
23 | }
24 | ],
25 | "result_keys": [
26 | "AnalyticsConfigurationList"
27 | ],
28 | "json_response": {
29 | "Id": "",
30 | "Filter_Prefix": "",
31 | "Filter_Tag_Key": "",
32 | "Filter_Tag_Value": "",
33 | "Filter_And_Prefix": "",
34 | "Filter_And_Tags_0_Key": "",
35 | "Filter_And_Tags_0_Value": "",
36 | "StorageClassAnalysis_DataExport_OutputSchemaVersion": "V_1",
37 | "StorageClassAnalysis_DataExport_Destination_S3BucketDestination_Format": "",
38 | "StorageClassAnalysis_DataExport_Destination_S3BucketDestination_BucketAccountId": "",
39 | "StorageClassAnalysis_DataExport_Destination_S3BucketDestination_Bucket": "",
40 | "StorageClassAnalysis_DataExport_Destination_S3BucketDestination_Prefix": ""
41 | }
42 | },
43 | {
44 | "function_name": "list_bucket_intelligent_tiering_configurations",
45 | "function_description": "Lists the S3 Intelligent-Tiering configuration",
46 | "response_format": "FORMAT_2",
47 | "function_type": "list",
48 | "is_regional": "N",
49 | "pagination_support": "N",
50 | "implclass": "_global_no_paginate",
51 | "implfunction": "process",
52 | "validation_functions": "",
53 | "is_multi_account_support": "Y",
54 | "boto_session_type": "client",
55 | "pagination_attributes": [
56 | {
57 | "attribute_name": "Bucket",
58 | "attribute_value": "",
59 | "is_visible": "Y",
60 | "display_prompt": "The name of the bucket",
61 | "type": "str"
62 | }
63 | ],
64 | "result_keys": [
65 | "IntelligentTieringConfigurationList"
66 | ],
67 | "json_response": {
68 | "Id": "",
69 | "Filter_Prefix": "",
70 | "Filter_Tag_Key": "",
71 | "Filter_Tag_Value": "",
72 | "Filter_And_Prefix": "",
73 | "Filter_And_Tags_0_Key": "",
74 | "Filter_And_Tags_0_Value": "",
75 | "Status": "",
76 | "Tierings_0_Days": "",
77 | "Tierings_0_AccessTier": ""
78 | }
79 | },
80 | {
81 | "function_name": "list_bucket_inventory_configurations",
82 | "function_description": "Lists the S3 Inventory configuration",
83 | "response_format": "FORMAT_2",
84 | "function_type": "list",
85 | "is_regional": "N",
86 | "pagination_support": "N",
87 | "implclass": "_global_no_paginate",
88 | "implfunction": "process",
89 | "validation_functions": "",
90 | "is_multi_account_support": "Y",
91 | "boto_session_type": "client",
92 | "pagination_attributes": [
93 | {
94 | "attribute_name": "Bucket",
95 | "attribute_value": "",
96 | "is_visible": "Y",
97 | "display_prompt": "The name of the bucket",
98 | "type": "str"
99 | }
100 | ],
101 | "result_keys": [
102 | "InventoryConfigurationList"
103 | ],
104 | "json_response": {
105 | "Destination_S3BucketDestination_AccountId": "",
106 | "Destination_S3BucketDestination_Bucket": "",
107 | "Destination_S3BucketDestination_Format": "",
108 | "Destination_S3BucketDestination_Prefix": "",
109 | "Destination_S3BucketDestination_Encryption_SSEKMS_KeyId": "",
110 | "IsEnabled": "",
111 | "Filter_Prefix": "",
112 | "Id": "",
113 | "IncludedObjectVersions": "",
114 | "OptionalFields_0": "",
115 | "Schedule_Frequency": ""
116 | }
117 | },
118 | {
119 | "function_name": "list_bucket_metrics_configurations",
120 | "function_description": "List Bucket Metrics Configurations",
121 | "response_format": "FORMAT_2",
122 | "function_type": "list",
123 | "is_regional": "N",
124 | "pagination_support": "N",
125 | "implclass": "_global_no_paginate",
126 | "implfunction": "process",
127 | "validation_functions": "",
128 | "is_multi_account_support": "Y",
129 | "boto_session_type": "client",
130 | "pagination_attributes": [
131 | {
132 | "attribute_name": "Bucket",
133 | "attribute_value": "",
134 | "is_visible": "Y",
135 | "display_prompt": "The name of the bucket",
136 | "type": "str"
137 | }
138 | ],
139 | "result_keys": [
140 | "MetricsConfigurationList"
141 | ],
142 | "json_response": {
143 | "Id": "string",
144 | "Filter_Prefix": "string",
145 | "Filter_Tag_Key": "string",
146 | "Filter_Tag_Value": "string",
147 | "Filter_AccessPointArn": "string",
148 | "Filter_And_Prefix": "string",
149 | "Filter_And_Tags_0_Key": "string",
150 | "Filter_And_Tags_0_Value": "string",
151 | "Filter_And_AccessPointArn": "string"
152 | }
153 | },
154 | {
155 | "function_name": "list_directory_buckets",
156 | "function_description": "list_directory_buckets",
157 | "response_format": "FORMAT_2",
158 | "function_type": "list",
159 | "is_regional": "N",
160 | "pagination_support": "N",
161 | "implclass": "_global_no_paginate",
162 | "implfunction": "process",
163 | "validation_functions": "",
164 | "is_multi_account_support": "Y",
165 | "boto_session_type": "client",
166 | "result_keys": [
167 | "Buckets"
168 | ],
169 | "json_response": {
170 | "Name": "",
171 | "CreationDate": ""
172 | }
173 | },
174 | {
175 | "function_name": "list_buckets",
176 | "function_description": "List of S3 buckets",
177 | "boto_session_type": "client",
178 | "response_format": "FORMAT_2",
179 | "function_type": "list",
180 | "is_regional": "Y",
181 | "pagination_support": "N",
182 | "implclass": "_global_no_paginate",
183 | "implfunction": "process",
184 | "validation_functions": "",
185 | "is_multi_account_support": "Y",
186 | "result_keys": [
187 | "Buckets"
188 | ],
189 | "json_response": {
190 | "Name": "required",
191 | "CreationDate": "required"
192 | }
193 | },
194 | {
195 | "function_name": "list_multipart_uploads",
196 | "function_description": "list buckets",
197 | "boto_session_type": "client",
198 | "response_format": "FORMAT_2",
199 | "function_type": "list",
200 | "is_regional": "N",
201 | "pagination_support": "N",
202 | "implclass": "_global_no_paginate",
203 | "implfunction": "process",
204 | "validation_functions": "",
205 | "is_multi_account_support": "Y",
206 | "pagination_attributes": [
207 | {
208 | "attribute_name": "Bucket",
209 | "attribute_value": "",
210 | "is_visible": "Y",
211 | "display_prompt": "The name of the bucket",
212 | "type": "str"
213 | }
214 | ],
215 | "result_keys": [
216 | "Uploads"
217 | ],
218 | "json_response": {
219 | "Key": "required",
220 | "LastModified": "required",
221 | "ETag": "string",
222 | "ChecksumAlgorithm_0": "string",
223 | "Size": "123",
224 | "StorageClass": "required",
225 | "Owner_DisplayName": "string",
226 | "Owner_ID": "string"
227 | }
228 | },
229 | {
230 | "function_name": "list_objects_v2",
231 | "function_description": "List Objects",
232 | "boto_session_type": "client",
233 | "response_format": "FORMAT_2",
234 | "function_type": "list",
235 | "is_regional": "N",
236 | "pagination_support": "Y",
237 | "implclass": "_global_paginate",
238 | "implfunction": "process",
239 | "pagination_attributes": [
240 | {
241 | "attribute_name": "Bucket",
242 | "attribute_value": "",
243 | "is_visible": "Y",
244 | "display_prompt": "The name of the bucket containing the objects",
245 | "type": "str"
246 | }
247 | ],
248 | "validation_functions": "",
249 | "is_multi_account_support": "N",
250 | "result_keys": [
251 | "Contents"
252 | ],
253 | "json_response": {
254 | "Key": "string",
255 | "LastModified": "",
256 | "ETag": "string",
257 | "ChecksumAlgorithm_0": "",
258 | "Size": "",
259 | "StorageClass": "",
260 | "Owner_DisplayName": "string",
261 | "Owner_ID": "string"
262 | }
263 | }
264 | ]
265 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/sagemaker.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "sagemaker",
3 | "functions": [
4 | {
5 | "function_name": "list_domains",
6 | "function_description": "Lists the domains. ",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Domains"
18 | ],
19 | "json_response": {
20 | "DomainArn": "string",
21 | "DomainId": "string",
22 | "DomainName": "string",
23 | "Status": "",
24 | "CreationTime": "",
25 | "LastModifiedTime": "",
26 | "Url": "string"
27 | }
28 | },
29 | {
30 | "function_name": "list_images",
31 | "function_description": "Lists the Images. ",
32 | "boto_session_type": "client",
33 | "response_format": "FORMAT_2",
34 | "function_type": "list",
35 | "is_regional": "Y",
36 | "pagination_support": "Y",
37 | "is_multi_account_support": "Y",
38 | "implclass": "_regional_paginate",
39 | "implfunction": "process",
40 | "validation_functions": "",
41 | "result_keys": [
42 | "Images"
43 | ],
44 | "json_response": {
45 | "CreationTime": "",
46 | "Description": "string",
47 | "DisplayName": "string",
48 | "FailureReason": "string",
49 | "ImageArn": "string",
50 | "ImageName": "string",
51 | "ImageStatus": "",
52 | "LastModifiedTime": ""
53 | }
54 | },
55 | {
56 | "function_name": "list_models",
57 | "function_description": "Lists the Images. ",
58 | "boto_session_type": "client",
59 | "response_format": "FORMAT_2",
60 | "function_type": "list",
61 | "is_regional": "Y",
62 | "pagination_support": "Y",
63 | "is_multi_account_support": "Y",
64 | "implclass": "_regional_paginate",
65 | "implfunction": "process",
66 | "validation_functions": "",
67 | "result_keys": [
68 | "Models"
69 | ],
70 | "json_response": {
71 | "ModelName": "string",
72 | "ModelArn": "string",
73 | "CreationTime": ""
74 | }
75 | },
76 | {
77 | "function_name": "list_projects",
78 | "function_description": "Lists the Projects. ",
79 | "boto_session_type": "client",
80 | "response_format": "FORMAT_2",
81 | "function_type": "list",
82 | "is_regional": "Y",
83 | "pagination_support": "N",
84 | "is_multi_account_support": "Y",
85 | "implclass": "_regional_no_paginate",
86 | "implfunction": "process",
87 | "validation_functions": "",
88 | "result_keys": [
89 | "ProjectSummaryList"
90 | ],
91 | "json_response": {
92 | "ProjectName": "string",
93 | "ProjectDescription": "string",
94 | "ProjectArn": "string",
95 | "ProjectId": "string",
96 | "CreationTime": "",
97 | "ProjectStatus": ""
98 | }
99 | },
100 | {
101 | "function_name": "list_user_profiles",
102 | "function_description": "Lists user profiles. ",
103 | "boto_session_type": "client",
104 | "response_format": "FORMAT_2",
105 | "function_type": "list",
106 | "is_regional": "Y",
107 | "pagination_support": "Y",
108 | "is_multi_account_support": "Y",
109 | "implclass": "_regional_paginate",
110 | "implfunction": "process",
111 | "validation_functions": "",
112 | "result_keys": [
113 | "UserProfiles"
114 | ],
115 | "json_response": {
116 | "DomainId": "string",
117 | "UserProfileName": "string",
118 | "Status": "",
119 | "CreationTime": "",
120 | "LastModifiedTime": ""
121 | }
122 | }
123 | ]
124 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/sns.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "sns",
3 | "functions": [
4 | {
5 | "function_name": "list_subscriptions",
6 | "function_description": "List subscriptions",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "Subscriptions"
18 | ],
19 | "json_response": {
20 | "SubscriptionArn": "string",
21 | "Owner": "string",
22 | "Protocol": "string",
23 | "Endpoint": "string",
24 | "TopicArn": "string"
25 | }
26 | },
27 | {
28 | "function_name": "list_topics",
29 | "function_description": "Returns a list of topics",
30 | "boto_session_type": "client",
31 | "response_format": "FORMAT_2",
32 | "function_type": "list",
33 | "is_regional": "Y",
34 | "pagination_support": "Y",
35 | "is_multi_account_support": "Y",
36 | "implclass": "_regional_paginate",
37 | "implfunction": "process",
38 | "validation_functions": "",
39 | "result_keys": [
40 | "Topics"
41 | ],
42 | "json_response": {
43 | "TopicArn": "string"
44 | }
45 | }
46 | ]
47 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/sqs.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "sqs",
3 | "functions": [
4 | {
5 | "function_name": "list_queues",
6 | "function_description": "Returns a list of queues",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_3",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "QueueUrls"
18 | ],
19 | "json_response": {
20 | "QueueUrl": ""
21 | }
22 | }
23 | ]
24 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_config_mgr/service_configs/ssm.json:
--------------------------------------------------------------------------------
1 | {
2 | "service_name": "ssm",
3 | "functions": [
4 | {
5 | "function_name": "describe_instance_information",
6 | "function_description": "Describe Instance Information",
7 | "boto_session_type": "client",
8 | "response_format": "FORMAT_2",
9 | "function_type": "list",
10 | "is_regional": "Y",
11 | "pagination_support": "Y",
12 | "is_multi_account_support": "Y",
13 | "implclass": "_regional_paginate",
14 | "implfunction": "process",
15 | "validation_functions": "",
16 | "result_keys": [
17 | "InstanceInformationList"
18 | ],
19 | "json_response": {
20 | "InstanceId": "",
21 | "PingStatus": "",
22 | "LastPingDateTime": "",
23 | "AgentVersion": "",
24 | "IsLatestVersion": "",
25 | "PlatformType": "",
26 | "PlatformName": "",
27 | "PlatformVersion": "",
28 | "ActivationId": "",
29 | "IamRole": "",
30 | "RegistrationDate": "",
31 | "ResourceType": "",
32 | "Name": "",
33 | "IPAddress": "",
34 | "ComputerName": "",
35 | "AssociationStatus": "",
36 | "LastAssociationExecutionDate": "",
37 | "LastSuccessfulAssociationExecutionDate": "",
38 | "AssociationOverview_DetailedStatus": "",
39 | "AssociationOverview_InstanceAssociationStatusAggregatedCount_": "",
40 | "SourceId": "",
41 | "SourceType": ""
42 | }
43 | }
44 | ]
45 | }
--------------------------------------------------------------------------------
/src/boto_formatter/service_formatter.py:
--------------------------------------------------------------------------------
1 |
2 | import logging
3 | from sys import modules
4 | import os
5 | import boto_formatter.json_util.json_util as json_util
6 | from boto_formatter.service_config_mgr.service_config import ServiceConfig
7 | import time
8 |
9 |
10 | # Set up our logger
11 | logging.basicConfig(level=logging.ERROR)
12 | logger = logging.getLogger()
13 |
14 |
15 | def service_response_formatter(service_name, function_name, response, attributes=None):
16 | """
17 | service_response_formatter
18 | :param service_name: example lambda, s3
19 | :param function_name: example list_functions
20 | :param response: list of json objects
21 | :param attributes: format_type,output_to,output_path,pagination,required_only
22 | :return: formatted response
23 | """
24 | format_type = None # Options are json or csv. Default is json
25 | output_to = None # Options are print or file. Default is print
26 | output_path = None # Default is none, user can provide custom path
27 | pagination = False
28 | required_only = None # Default is none if required only fields
29 | # default type is json. Supported types are json,csv
30 | if attributes is not None:
31 | if "format_type" in attributes:
32 | format_type = attributes["format_type"]
33 | # output_to default is None. Supported options are cmd,file,s3
34 | if "output_to" in attributes:
35 | output_to = attributes["output_to"]
36 | # output_to default is None. Supported options are complete file path or S3 path
37 | if "output_path" in attributes:
38 | output_path = attributes["output_path"]
39 | if "pagination" in attributes:
40 | if attributes["pagination"] == "True":
41 | pagination = True
42 | if "required_only" in attributes:
43 | required_only = True
44 | if output_path is None:
45 | output_path = os.getcwd()
46 | json_config = None
47 | result = None
48 | function_config = ServiceConfig.get_service_function_details(
49 | service_name, function_name)
50 | json_config = function_config["json_response"]
51 | response_format = function_config["response_format"]
52 | # Some columns breaks as comma so for csv format put required only condition
53 |
54 | start_time = time.time()
55 | result = __process_response(
56 | function_config, json_config, format_type, required_only, response, pagination)
57 | logger.debug("Flattening JSON took--- %s seconds ---" %
58 | (time.time() - start_time))
59 | if format_type:
60 | result = __format_ouput(result, format_type)
61 | if output_to:
62 | result = __ouput_to(service_name, function_name,
63 | result, output_to, format_type,
64 | output_path, response_format)
65 | return result
66 |
67 |
68 | def __process_response(function_config, json_config, format_type, required_only, response, pagination):
69 | """
70 | :param function_config : function defined in service_config.json
71 | :param json_config: reference response
72 | :param required_only: if present filter the result for required onlydata
73 | :param response : List of Json object
74 | :pagination :if present json list is part of pagination
75 | :return: formatted list of flattend JSON objects
76 | """
77 | response_format = function_config["response_format"]
78 | result_keys = None
79 | final_result = []
80 | if "result_keys" in function_config.keys():
81 | result_keys = function_config["result_keys"]
82 | if required_only is None and format_type is not None:
83 | if "csv_enforced_required_only" in function_config.keys() and format_type == "csv":
84 | required_only = "Yes"
85 | # FORMAT_1 : JSON single record
86 | # FORMAT_2 : JSON contains List of JSON
87 | # FORMAT_3 : JSON contains List of Strings
88 | if response_format == "FORMAT_2":
89 | # if pagination then get extended loop
90 | if pagination:
91 | for item in response:
92 | result = item["result"]
93 | prefix_columns = None
94 | # prefix_colums work differently in service_formatter and core_formatter
95 | if "prefix_columns" in item.keys():
96 | prefix_columns = item["prefix_columns"]
97 | for obj in result:
98 | final_result.extend(json_util.format_json_list(json_config, json_util.format_response_for_result_keys(
99 | obj, result_keys), required_only, prefix_columns))
100 | else:
101 | for item in response:
102 | result = item["result"]
103 | prefix_columns = None
104 | if "prefix_columns" in item.keys():
105 | prefix_columns = item["prefix_columns"]
106 | final_result.extend(json_util.format_json_list(json_config, json_util.format_response_for_result_keys(
107 | result, result_keys), required_only, prefix_columns))
108 | elif response_format == "FORMAT_1":
109 | final_result = json_util.format_json_object(json_config, response)
110 |
111 | elif response_format == "FORMAT_3":
112 | # if pagination then get extended loop
113 | if pagination:
114 | for item in response:
115 | result = item["result"]
116 | prefix_columns = None
117 | # prefix_colums work differently in service_formatter and core_formatter
118 | if "prefix_columns" in item.keys():
119 | prefix_columns = item["prefix_columns"]
120 | for obj in result:
121 | final_result.extend(json_util.format_str_list(json_config, json_util.format_response_for_result_keys(
122 | obj, result_keys), required_only, prefix_columns))
123 | else:
124 | for item in response:
125 | result = item["result"]
126 | prefix_columns = None
127 | if "prefix_columns" in item.keys():
128 | prefix_columns = item["prefix_columns"]
129 | final_result.extend(json_util.format_str_list(json_config, json_util.format_response_for_result_keys(
130 | result, result_keys), required_only, prefix_columns))
131 |
132 | return final_result
133 |
134 |
135 | def __format_ouput(result, format_type):
136 | """
137 | :param result : Flatten JSON list
138 | :param format_type: currently supported only csv
139 | :return: formatted list of comma seperated string
140 | """
141 | if format_type == "csv":
142 | return json_util.get_csv_data(result)
143 | else:
144 | return result
145 |
146 |
147 | def __ouput_to(service_name, function_name, result, output_to, format_type, output_path, response_format):
148 | """
149 | :param service_name :service_name like s3, lambda
150 | :param function_name: function name like list_buckets
151 | :param function_name: processed result
152 | :param format_type: csv or json
153 | :param output_path: user provided output_path to save file
154 | :response_format:FORMAT_1,FORMAT_2,FORMAT_3
155 | :return: formatted list of comma seperated string
156 | """
157 | if output_to == "print":
158 | return json_util.print_csv_response(result)
159 | elif output_to == "file" or output_to == "s3":
160 | if format_type:
161 | file_path = None
162 | if format_type == "csv":
163 | file_path = json_util.save_csv(
164 | result, service_name, function_name, output_path)
165 | else:
166 | file_path = json_util.save_json(
167 | result, service_name, function_name, output_path)
168 | return file_path
169 | else:
170 | return result
171 |
--------------------------------------------------------------------------------
/tests/boto_magic_formatter_usage.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | FAQ 1 : What are configuratoin options for boto_magic_formatter
4 | boto_magic_formatter Decorator configuration options:
5 | 1. format_type: Options are --> csv|json Defaut is json.
6 | 2. output_to: Options are --> print|cmd|s3 . Default is None.
7 | 3. file_name: Options are --> file_name in string format. Default is system generated.
8 | 4. s3_bucket: Options are --> S3 Bucket Name in string format. Default is None. This is required only
9 | when you want to save the file in S3 Bucket
10 | 5. s3_bucket_prefix Options are --> S3 Bucket Prefix in string format. Default is None
11 |
12 | Place holder function configuration options:
13 | 1. _session: boto3 session (Mandatory).
14 | 2. service_name: boto3 service name (Mandatory).
15 | 3. function_name: boto3 function_name (Mandatory)
16 | 4. attributes: Optional in a format attributes = {"" : ""}
17 | 5. prefix_columns: Optional in a format {"prefix_columns": {"":""}}
18 |
19 | """
20 |
21 | import boto3
22 | from boto_formatter.boto_magic_formatter import boto_magic_formatter
23 |
24 |
25 |
26 | @boto_magic_formatter(format_type="csv", output_to="file")
27 | def list_resources_to_file(_session, service_name, function_name, **attributes):
28 | """
29 | Place holder function. Decorator does all the magic and generate the result.
30 | """
31 | result = None
32 | return result
33 |
34 |
35 | """
36 | Returns flatten Json list for further processing
37 | """
38 | @boto_magic_formatter()
39 | def list_resources(_session, service_name, function_name, **kwargs):
40 | """
41 | Place holder function. Decorator does all the magic and generate the result.
42 | """
43 | result = None
44 | return result
45 |
46 | """
47 | Save .csv file on S3 bucket
48 | """
49 | @boto_magic_formatter(format_type="json", output_to="s3", s3_bucket="abcbucket")
50 | def list_resources_to_s3(_session, service_name, function_name, **kwargs):
51 | """
52 | Place holder function. Decorator does all the magic and update the result.
53 | """
54 | result = None
55 | return result
56 |
57 |
58 | if __name__ == "__main__":
59 | _session = boto3.session.Session()
60 | """
61 | Example 1 : Generate .csv file containing list of AWS resources .
62 | Notice that you are using the same list_resource_to_file proxy function to generate a CSV file containing a list of AWS resources.
63 | """
64 | list_resources_to_file(_session, "accessanalyzer", "list_analyzers")
65 | list_resources_to_file(_session, "s3", "list_buckets")
66 | list_resources_to_file(_session, "lambda", "list_functions")
67 | list_resources_to_file(_session, "iam", "list_roles",)
68 | list_resources_to_file(_session, "ssm", "describe_instance_information")
69 |
70 | """
71 | Example 2 : Generate List of AWS resources in .csv format by passing input to function
72 | like list all objects in specific S3 bucket
73 | """
74 | # If perticular function takes input you can pass input as a attribute like BucketName
75 | attributes = {"Bucket" : "abcbucket"}
76 | list_resources_to_file(_session, "s3", "list_objects_v2", attributes=attributes)
77 |
78 |
79 | """
80 | Example 3 : Upload the result to s3 bucket.
81 | """
82 | # If perticular function takes input you can pass input as a attribute like BucketName
83 | list_resources_to_s3(_session, "lambda", "list_functions")
84 |
85 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/accessanalyzer_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="accessanalyzer", function_name="list_analyzers", format_type="csv", output_to="file" ,pagination="yes")
6 | def list_analyzers_fmt():
7 | client = boto3.client('accessanalyzer')
8 | paginator = client.get_paginator('list_analyzers')
9 | result = []
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 | @boto_response_formatter(service_name="accessanalyzer", function_name="list_findings", format_type="csv", output_to="file" ,pagination="yes")
15 | def list_findings_fmt():
16 | client = boto3.client('accessanalyzer')
17 | paginator = client.get_paginator('list_findings')
18 | analyzerArn="analyzerArn"
19 | #analyzerArn="tt"
20 | result = []
21 | for page in paginator.paginate(analyzerArn=analyzerArn):
22 | result.append(page)
23 | return result
24 |
25 |
26 | if __name__ == "__main__":
27 | list_analyzers_fmt()
28 | list_findings_fmt()
29 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/apigateway_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 | # No Pagination
5 | @boto_response_formatter(service_name="apigateway", function_name="get_rest_apis", format_type="csv", output_to="file")
6 | def list_rest_apis():
7 | client = boto3.client('apigateway')
8 | result = client.get_rest_apis()
9 | return result
10 |
11 |
12 | if __name__ == "__main__":
13 | list_rest_apis()
14 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/budgets_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 | from session_mgr.iam_session_mgr import IAMSessionManager
4 |
5 | @boto_response_formatter(service_name="budgets", function_name="describe_budgets", format_type="csv", output_to="file" ,pagination="yes")
6 | def describe_budget_fmt():
7 | client = boto3.client('budgets')
8 | paginator = client.get_paginator('describe_budgets')
9 | result = []
10 | for page in paginator.paginate(AccountId="AccountId"):
11 | result.append(page)
12 | return result
13 |
14 |
15 | @boto_response_formatter(service_name="budgets", function_name="describe_budgets", format_type="csv", output_to="file" ,pagination="yes")
16 | def describe_budget_fmt_36():
17 | _session = IAMSessionManager().get_iam_session("AccountId")
18 | client = _session.client('budgets')
19 | paginator = client.get_paginator('describe_budgets')
20 | result = []
21 | for page in paginator.paginate(AccountId="AccountId"):
22 | result.append(page)
23 | return result
24 |
25 | if __name__ == "__main__":
26 | #describe_budget_fmt()
27 | describe_budget_fmt_36()
28 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/cloudfront_usage.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import boto3
3 | from boto_formatter.core_formatter import boto_response_formatter
4 |
5 |
6 |
7 | @boto_response_formatter(service_name="cloudfront", function_name="list_distributions", format_type="csv", output_to="file" ,pagination="yes")
8 | def list_distributions_fmt():
9 | client = boto3.client('cloudfront')
10 | paginator = client.get_paginator('list_distributions')
11 | result = []
12 | for page in paginator.paginate():
13 | result.append(page)
14 | return result
15 |
16 |
17 | @boto_response_formatter(service_name="cloudfront", function_name="list_functions", format_type="csv", output_to="file" )
18 | def list_functions_fmt():
19 | client = boto3.client('cloudfront')
20 | result = client.list_functions()
21 | return result
22 |
23 |
24 | if __name__ == "__main__":
25 | list_distributions_fmt()
26 | list_functions_fmt()
--------------------------------------------------------------------------------
/tests/core_formatter_usages/cloudtrail_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="cloudtrail", function_name="list_trails", format_type="csv", output_to="file" ,pagination="yes")
6 | def list_trails_fmt():
7 | client = boto3.client('cloudtrail')
8 | paginator = client.get_paginator('list_trails')
9 | result = []
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | if __name__ == "__main__":
16 | list_trails_fmt()
17 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/dynamodb_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="dynamodb", function_name="list_tables", format_type="csv", output_to="file" ,pagination="yes")
6 | def list_tables_fmt():
7 | client = boto3.client('dynamodb')
8 | paginator = client.get_paginator('list_tables')
9 | result = []
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | if __name__ == "__main__":
16 | list_tables_fmt()
17 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/ec2_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="ec2", function_name="describe_addresses", format_type="csv", output_to="file" )
6 | def describe_addresses_fmt():
7 | client = boto3.client('ec2')
8 | result = client.describe_addresses()
9 | return result
10 |
11 |
12 | @boto_response_formatter(service_name="ec2", function_name="describe_flow_logs", format_type="csv", output_to="file" ,pagination="True")
13 | def describe_flow_logs_fmt():
14 | client = boto3.client('ec2')
15 | paginator = client.get_paginator('describe_flow_logs')
16 | result = []
17 | for page in paginator.paginate():
18 | result.append(page)
19 | return result
20 |
21 |
22 | @boto_response_formatter(service_name="ec2", function_name="describe_instances", format_type="csv", output_to="file" ,pagination="True")
23 | def describe_instances_fmt():
24 | client = boto3.client('ec2')
25 | paginator = client.get_paginator('describe_instances')
26 | result = []
27 | for page in paginator.paginate():
28 | result.append(page)
29 | return result
30 |
31 |
32 | @boto_response_formatter(service_name="ec2", function_name="describe_network_acls", format_type="csv", output_to="file" ,pagination="True")
33 | def describe_network_acls_fmt():
34 | client = boto3.client('ec2')
35 | paginator = client.get_paginator('describe_network_acls')
36 | result = []
37 | for page in paginator.paginate():
38 | result.append(page)
39 | return result
40 |
41 |
42 | @boto_response_formatter(service_name="ec2", function_name="describe_route_tables", format_type="csv", output_to="file" ,pagination="True")
43 | def describe_route_tables_fmt():
44 | client = boto3.client('ec2')
45 | paginator = client.get_paginator('describe_route_tables')
46 | result = []
47 | for page in paginator.paginate():
48 | result.append(page)
49 | return result
50 |
51 |
52 | @boto_response_formatter(service_name="ec2", function_name="describe_security_groups", format_type="csv", output_to="file" ,pagination="True")
53 | def describe_security_groups_fmt():
54 | client = boto3.client('ec2')
55 | paginator = client.get_paginator('describe_security_groups')
56 | result = []
57 | for page in paginator.paginate():
58 | result.append(page)
59 | return result
60 |
61 |
62 | @boto_response_formatter(service_name="ec2", function_name="describe_security_group_rules", format_type="csv", output_to="file" ,pagination="True")
63 | def describe_security_group_rules_fmt():
64 | client = boto3.client('ec2')
65 | paginator = client.get_paginator('describe_security_group_rules')
66 | result = []
67 | for page in paginator.paginate():
68 | result.append(page)
69 | return result
70 |
71 |
72 | @boto_response_formatter(service_name="ec2", function_name="describe_snapshots", format_type="csv", output_to="file" ,pagination="True")
73 | def describe_snapshots_fmt():
74 | client = boto3.client('ec2')
75 | paginator = client.get_paginator('describe_snapshots')
76 | OwnerIds = ["self"]
77 | result = []
78 | for page in paginator.paginate(OwnerIds=OwnerIds):
79 | result.append(page)
80 | return result
81 |
82 |
83 | @boto_response_formatter(service_name="ec2", function_name="describe_subnets", format_type="csv", output_to="file" ,pagination="True")
84 | def describe_subnets_fmt():
85 | client = boto3.client('ec2')
86 | paginator = client.get_paginator('describe_subnets')
87 | result = []
88 | for page in paginator.paginate():
89 | result.append(page)
90 | return result
91 |
92 |
93 | @boto_response_formatter(service_name="ec2", function_name="describe_transit_gateways", format_type="csv", output_to="file" ,pagination="True")
94 | def describe_transit_gateways_fmt():
95 | client = boto3.client('ec2')
96 | paginator = client.get_paginator('describe_transit_gateways')
97 | result = []
98 | for page in paginator.paginate():
99 | result.append(page)
100 | return result
101 |
102 |
103 | @boto_response_formatter(service_name="ec2", function_name="describe_volumes", format_type="csv", output_to="file" ,pagination="True")
104 | def describe_volumes_fmt():
105 | client = boto3.client('ec2')
106 | paginator = client.get_paginator('describe_volumes')
107 | result = []
108 | for page in paginator.paginate():
109 | result.append(page)
110 | return result
111 |
112 |
113 | @boto_response_formatter(service_name="ec2", function_name="describe_vpcs", format_type="csv", output_to="file" ,pagination="True")
114 | def describe_vpcs_fmt():
115 | client = boto3.client('ec2')
116 | paginator = client.get_paginator('describe_vpcs')
117 | result = []
118 | for page in paginator.paginate():
119 | result.append(page)
120 | return result
121 |
122 |
123 | @boto_response_formatter(service_name="ec2", function_name="describe_vpc_endpoints", format_type="csv", output_to="file" ,pagination="True")
124 | def describe_vpc_endpoints_fmt():
125 | client = boto3.client('ec2')
126 | paginator = client.get_paginator('describe_vpc_endpoints')
127 | result = []
128 | for page in paginator.paginate():
129 | result.append(page)
130 | return result
131 |
132 |
133 | @boto_response_formatter(service_name="ec2", function_name="describe_vpc_endpoints", format_type="csv", output_to="file" ,pagination="True")
134 | def describe_describe_vpc_endpoints_fmt():
135 | client = boto3.client('ec2')
136 | paginator = client.get_paginator('describe_vpc_endpoints')
137 | result = []
138 | for page in paginator.paginate():
139 | result.append(page)
140 | return result
141 |
142 |
143 | @boto_response_formatter(service_name="ec2", function_name="describe_vpc_peering_connections", format_type="csv", output_to="file" ,pagination="True")
144 | def describe_vpc_peering_connections_fmt():
145 | client = boto3.client('ec2')
146 | paginator = client.get_paginator('describe_vpc_peering_connections')
147 | result = []
148 | for page in paginator.paginate():
149 | result.append(page)
150 | return result
151 |
152 |
153 | @boto_response_formatter(service_name="ec2", function_name="describe_vpn_connections", format_type="csv", output_to="file" )
154 | def describe_vpn_connections_fmt():
155 | client = boto3.client('ec2')
156 | result = client.describe_vpn_connections()
157 | return result
158 |
159 |
160 | if __name__ == "__main__":
161 | describe_addresses_fmt()
162 | describe_flow_logs_fmt()
163 | describe_instances_fmt()
164 | describe_network_acls_fmt()
165 | describe_route_tables_fmt()
166 | describe_security_groups_fmt()
167 | describe_security_group_rules_fmt()
168 | describe_snapshots_fmt()
169 | describe_subnets_fmt()
170 | describe_transit_gateways_fmt()
171 | describe_volumes_fmt()
172 | describe_vpcs_fmt()
173 | describe_vpc_endpoints_fmt()
174 | describe_vpc_peering_connections_fmt()
175 | describe_vpn_connections_fmt()
176 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/ecs_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 | from botocore.exceptions import ClientError
4 |
5 |
6 |
7 |
8 | @boto_response_formatter(service_name="ecs", function_name="list_clusters", format_type="csv", output_to="file" ,pagination="True")
9 | def list_clusters_fmt():
10 | result = []
11 | try:
12 | client = boto3.client('ecs')
13 | paginator = client.get_paginator('list_clusters')
14 | for page in paginator.paginate():
15 | result.append(page)
16 | except ClientError as e:
17 | print(e)
18 | print(result)
19 | return result
20 |
21 | @boto_response_formatter(service_name="ecs", function_name="list_services", format_type="csv", output_to="file" ,pagination="True")
22 | def list_services_fmt():
23 | client = boto3.client('ecs')
24 | paginator = client.get_paginator('list_services')
25 | result = []
26 | try:
27 | # cluster= The short name or full Amazon Resource Name (ARN) of the cluster to use when filtering the ListServices results. If you do not specify a cluster, the default cluster is assumed.
28 | for page in paginator.paginate(cluster=""):
29 | result.append(page)
30 | except ClientError as e:
31 | print(e)
32 | return result
33 |
34 | @boto_response_formatter(service_name="ecs", function_name="list_tasks", format_type="csv", output_to="file" ,pagination="True")
35 | def list_tasks_fmt():
36 | client = boto3.client('ecs')
37 | paginator = client.get_paginator('list_tasks')
38 | result = []
39 | # cluster= The short name or full Amazon Resource Name (ARN) of the cluster to use when filtering the ListServices results. If you do not specify a cluster, the default cluster is assumed.
40 | for page in paginator.paginate():
41 | result.append(page)
42 | return result
43 |
44 |
45 |
46 | if __name__ == "__main__":
47 | list_clusters_fmt()
48 | #list_services_fmt()
49 | #list_tasks_fmt()
50 | #print(result)
51 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/efs_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="efs", function_name="describe_file_systems", format_type="csv", output_to="file" ,pagination="True")
6 | def describe_file_systems_fmt():
7 | result = []
8 | client = boto3.client('efs')
9 | paginator = client.get_paginator('describe_file_systems')
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | if __name__ == "__main__":
16 | describe_file_systems_fmt()
17 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/eks_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | import botocore
3 | from boto_formatter.core_formatter import boto_response_formatter
4 |
5 |
6 |
7 |
8 | @boto_response_formatter(service_name="eks", function_name="describe_cluster", format_type="csv", output_to="file" )
9 | def describe_cluster_fmt():
10 | result = []
11 | try:
12 | client = boto3.client('eks')
13 | result = client.describe_cluster(name='string')
14 |
15 | except client.exceptions.ResourceNotFoundException as e:
16 | print(e)
17 | return result
18 |
19 | @boto_response_formatter(service_name="eks", function_name="list_clusters", format_type="csv", output_to="file" ,pagination="True")
20 | def list_clusters_fmt():
21 | client = boto3.client('eks')
22 | paginator = client.get_paginator('list_clusters')
23 | result = []
24 |
25 | # cluster= The short name or full Amazon Resource Name (ARN) of the cluster to use when filtering the ListServices results. If you do not specify a cluster, the default cluster is assumed.
26 | for page in paginator.paginate():
27 | result.append(page)
28 | return result
29 |
30 | @boto_response_formatter(service_name="eks", function_name="list_fargate_profiles", format_type="csv", output_to="file" ,pagination="True")
31 | def list_fargate_profiles_fmt():
32 | result = []
33 | try:
34 | client = boto3.client('eks')
35 | paginator = client.get_paginator('list_fargate_profiles')
36 | result = []
37 | pagination_attributes = {
38 | "clusterName": "dfdf",
39 | }
40 | for page in paginator.paginate(**pagination_attributes):
41 | result.append(page)
42 | except client.exceptions.ResourceNotFoundException as e:
43 | print(e)
44 | return result
45 |
46 |
47 | if __name__ == "__main__":
48 | #describe_cluster_fmt()
49 | #list_clusters_fmt()
50 | list_fargate_profiles_fmt()
51 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/elbv2_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="elbv2", function_name="describe_load_balancers", format_type="csv", output_to="file" ,pagination="True")
6 | def describe_load_balancers_fmt():
7 | result = []
8 | client = boto3.client('elbv2')
9 | paginator = client.get_paginator('describe_load_balancers')
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | if __name__ == "__main__":
16 | describe_load_balancers_fmt()
17 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/emr-serverless_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 | @boto_response_formatter(service_name="emr-serverless", function_name="list_applications", format_type="csv", output_to="file",pagination="True" )
5 | def list_applications_fmt():
6 | client = boto3.client('emr-serverless')
7 | paginator = client.get_paginator('list_applications')
8 | result = []
9 | for page in paginator.paginate():
10 | result.append(page)
11 | return result
12 |
13 | #TODO
14 | #Permission Issues
15 | @boto_response_formatter(service_name="emr-serverless", function_name="list_job_runs", format_type="csv", output_to="file",pagination="True" )
16 | def list_job_runs_fmt():
17 | client = boto3.client('emr-serverless')
18 | paginator = client.get_paginator('list_job_runs')
19 | result = []
20 | pagination_attributes = {
21 | "applicationId": "dfdf",
22 | }
23 | for page in paginator.paginate(**pagination_attributes):
24 | result.append(page)
25 | return result
26 |
27 | if __name__ == "__main__":
28 | list_applications_fmt()
29 | list_job_runs_fmt()
30 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/emr_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="emr", function_name="list_clusters", format_type="csv", output_to="file" ,pagination="True")
6 | def list_clusters_fmt():
7 | client = boto3.client('emr')
8 | paginator = client.get_paginator('list_clusters')
9 | result = []
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | @boto_response_formatter(service_name="emr", function_name="list_instance_fleets", format_type="csv", output_to="file" ,pagination="True")
16 | def list_instance_fleets_fmt():
17 | client = boto3.client('emr')
18 | paginator = client.get_paginator('list_instance_fleets')
19 | result = []
20 | for page in paginator.paginate(ClusterId=""):
21 | result.append(page)
22 | return result
23 |
24 |
25 | @boto_response_formatter(service_name="emr", function_name="list_notebook_executions", format_type="csv", output_to="file" ,pagination="True")
26 | def list_notebook_executions_fmt():
27 | client = boto3.client('emr')
28 | paginator = client.get_paginator('list_notebook_executions')
29 | result = []
30 | for page in paginator.paginate():
31 | result.append(page)
32 | return result
33 |
34 |
35 | @boto_response_formatter(service_name="emr", function_name="list_studios", format_type="csv", output_to="file" ,pagination="True")
36 | def list_studios_fmt():
37 | client = boto3.client('emr')
38 | paginator = client.get_paginator('list_studios')
39 | result = []
40 | for page in paginator.paginate():
41 | result.append(page)
42 | return result
43 |
44 |
45 |
46 |
47 |
48 | if __name__ == "__main__":
49 | list_clusters_fmt()
50 | #list_instance_fleets_fmt()
51 | list_studios_fmt()
52 | list_notebook_executions_fmt()
53 |
54 |
55 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/general_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from botocore.config import Config
3 | from boto_formatter.core_formatter import boto_response_formatter
4 |
5 | '''
6 | #boto_response_formatter(
7 | service_name="apigateway", **required
8 | function_name="get_rest_apis", **required
9 | format_type = "csv|json", optional default is json
10 | output_to="print|file|s3", optional default is none
11 | output_path="complete file path where you want to generate the output",optional
12 | prefix_columns="You can pass prefix columsn like regions/account": Optional
13 | pagination="If your result set is generated through Pagination it should have this attribute as yes": Optional
14 | required_only="if you want to print only important columns"
15 | )
16 | '''
17 |
18 | #Example : Pagination: If underlying function uses pagination you must pass pagination =True
19 | @boto_response_formatter(service_name="ec2", function_name="describe_instances", format_type="csv", output_to="file" ,pagination="True")
20 | def pagination_example():
21 | client = boto3.client('ec2')
22 | paginator = client.get_paginator('describe_instances')
23 | result = []
24 | for page in paginator.paginate():
25 | result.append(page)
26 | return result
27 |
28 | #Example : Without Pagination: If underlying function not uses pagination you don't pass pagination attribute
29 | @boto_response_formatter(service_name="s3", function_name="list_buckets", format_type="csv", output_to="file")
30 | def no_pagination_example():
31 | client = boto3.client('s3')
32 | result = client.list_buckets()
33 | return result
34 |
35 |
36 | #Example : format_type can be json or csv
37 | @boto_response_formatter(service_name="s3", function_name="list_buckets", format_type="json", output_to="file")
38 | def json_format_example():
39 | client = boto3.client('s3')
40 | result = client.list_buckets()
41 | return result
42 |
43 | #Example : You can use region when creating boto client to get list of resources in specfic region
44 | @boto_response_formatter(service_name="ec2", function_name="describe_instances", format_type="csv", output_to="file" ,pagination="True")
45 | def region_example():
46 | my_config = Config(region_name='us-west-2')
47 | client = boto3.client('ec2', config=my_config)
48 | paginator = client.get_paginator('describe_instances')
49 | result = []
50 | for page in paginator.paginate():
51 | result.append(page)
52 | return result
53 |
54 |
55 | #Example :Passing response generated by boto_response_formatter decorator to another function
56 | #Notice not passing file or any addtional attributes
57 | @boto_response_formatter(service_name="s3", function_name="list_buckets")
58 | def s3_bucket_flatten():
59 | client = boto3.client('s3')
60 | result = client.list_buckets()
61 | return result
62 |
63 | #Example :Passing response generated by boto_response_formatter decorator to another function
64 | def processing_example():
65 | response = s3_bucket_flatten()
66 | for bucket in response:
67 | print(bucket["Name"])
68 |
69 |
70 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/iam_usage.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import boto3
3 | from boto_formatter.core_formatter import boto_response_formatter
4 |
5 | @boto_response_formatter(service_name="iam", function_name="list_access_keys", format_type="csv", output_to="print",pagination="yes")
6 | def list_access_keys_fmt():
7 | client = boto3.client('iam')
8 | paginator = client.get_paginator('list_access_keys')
9 | result = []
10 | for page in paginator.paginate(UserName=""):
11 | result.append(page)
12 | return result
13 |
14 | @boto_response_formatter(service_name="iam", function_name="list_roles", format_type="csv", output_to="file" ,pagination="yes")
15 | def list_roles_fmt():
16 | client = boto3.client('iam')
17 | paginator = client.get_paginator('list_roles')
18 | result = []
19 | for page in paginator.paginate():
20 | result.append(page)
21 | return result
22 |
23 | #@boto_response_formatter(service_name="iam", function_name="list_account_aliases", format_type="csv", output_to="file" ,pagination="yes")
24 | def list_account_aliases_fmt():
25 | result = []
26 | client = boto3.client('iam')
27 | paginator = client.get_paginator('list_account_aliases')
28 | for page in paginator.paginate():
29 | result.append(page)
30 | print(result)
31 | return result
32 |
33 | @boto_response_formatter(service_name="iam", function_name="list_policies", format_type="csv", output_to="file" ,pagination="yes")
34 | def list_policies_fmt():
35 | client = boto3.client('iam')
36 | paginator = client.get_paginator('list_policies')
37 | result = []
38 | for page in paginator.paginate():
39 | result.append(page)
40 | return result
41 |
42 |
43 | @boto_response_formatter(service_name="iam", function_name="list_users", format_type="csv", output_to="file" ,pagination="yes")
44 | def list_users_fmt():
45 | client = boto3.client('iam')
46 | paginator = client.get_paginator('list_users')
47 | result = []
48 | for page in paginator.paginate():
49 | result.append(page)
50 | return result
51 |
52 | #@boto_response_formatter(service_name="iam", function_name="list_group_policies", format_type="csv", output_to="file" ,pagination="yes")
53 | def list_group_policies_fmt():
54 | client = boto3.client('iam')
55 | paginator = client.get_paginator('list_group_policies')
56 | result = []
57 | for page in paginator.paginate(GroupName="MyGroup"):
58 | result.append(page)
59 | return result
60 |
61 | if __name__ == "__main__":
62 | #list_access_keys_fmt()
63 | #list_roles_fmt()
64 | #list_users_fmt()
65 | #list_group_policies_fmt()
66 | list_account_aliases_fmt()
67 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/lambda_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="lambda", function_name="list_functions", format_type="csv", output_to="file")
6 | def list_functions():
7 | client = boto3.client('lambda')
8 | result = client.list_functions()
9 | return result
10 |
11 |
12 | @boto_response_formatter(service_name="lambda", function_name="list_layers", format_type="csv", output_to="file")
13 | def list_layers():
14 | client = boto3.client('lambda')
15 | result = client.list_layers(CompatibleRuntime='python3.6')
16 | return result
17 |
18 |
19 | if __name__ == "__main__":
20 | list_functions()
21 | list_layers()
22 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/organizations_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="organizations", function_name="list_accounts", format_type="csv", output_to="file" ,pagination="yes")
6 | def list_accounts_fmt():
7 | client = boto3.client('organizations')
8 | paginator = client.get_paginator('list_accounts')
9 | result = []
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | @boto_response_formatter(service_name="organizations", function_name="list_policies", format_type="csv", output_to="file" ,pagination="yes")
16 | def list_policies_fmt():
17 | client = boto3.client('organizations')
18 | paginator = client.get_paginator('list_policies')
19 | result = []
20 | attributes = {"Filter":"SERVICE_CONTROL_POLICY"}
21 | for page in paginator.paginate(**attributes):
22 | result.append(page)
23 | return result
24 |
25 |
26 |
27 |
28 | if __name__ == "__main__":
29 | list_accounts_fmt()
30 | list_policies_fmt()
31 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/rds_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="rds", function_name="describe_db_clusters", format_type="csv", output_to="file",pagination="True" )
6 | def describe_db_clusters_fmt():
7 | client = boto3.client('rds')
8 | paginator = client.get_paginator('describe_db_clusters')
9 | result = []
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | @boto_response_formatter(service_name="rds", function_name="describe_db_instances", format_type="csv", output_to="file",pagination="True" )
16 | def describe_db_instances_fmt():
17 | client = boto3.client('rds')
18 | paginator = client.get_paginator('describe_db_instances')
19 | result = []
20 | for page in paginator.paginate():
21 | result.append(page)
22 | return result
23 |
24 |
25 | @boto_response_formatter(service_name="rds", function_name="describe_db_security_groups", format_type="csv", output_to="file",pagination="True" )
26 | def describe_db_security_groups_fmt():
27 | client = boto3.client('rds')
28 | paginator = client.get_paginator('describe_db_security_groups')
29 | result = []
30 | for page in paginator.paginate():
31 | result.append(page)
32 | return result
33 |
34 |
35 | @boto_response_formatter(service_name="rds", function_name="describe_db_snapshots", format_type="csv", output_to="file",pagination="True" )
36 | def describe_db_snapshots_fmt():
37 | client = boto3.client('rds')
38 | paginator = client.get_paginator('describe_db_snapshots')
39 | result = []
40 | for page in paginator.paginate():
41 | result.append(page)
42 | return result
43 |
44 |
45 | @boto_response_formatter(service_name="rds", function_name="describe_global_clusters", format_type="csv", output_to="file",pagination="True" )
46 | def describe_global_clusters_fmt():
47 | client = boto3.client('rds')
48 | paginator = client.get_paginator('describe_global_clusters')
49 | result = []
50 | for page in paginator.paginate():
51 | result.append(page)
52 | return result
53 |
54 | if __name__ == "__main__":
55 | describe_db_clusters_fmt()
56 | describe_db_instances_fmt()
57 | describe_db_security_groups_fmt()
58 | describe_db_snapshots_fmt()
59 | describe_global_clusters_fmt()
60 |
61 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/redshift-serverless_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 | @boto_response_formatter(service_name="redshift-serverless", function_name="list_namespaces", format_type="csv", output_to="file",pagination="True" )
5 | def list_namespaces_fmt():
6 | client = boto3.client('redshift-serverless')
7 | paginator = client.get_paginator('list_namespaces')
8 | result = []
9 | for page in paginator.paginate():
10 | result.append(page)
11 | return result
12 |
13 |
14 | @boto_response_formatter(service_name="redshift-serverless", function_name="list_workgroups", format_type="csv", output_to="file",pagination="True" )
15 | def list_workgroups_fmt():
16 | client = boto3.client('redshift-serverless')
17 | paginator = client.get_paginator('list_workgroups')
18 | result = []
19 | for page in paginator.paginate():
20 | result.append(page)
21 | return result
22 |
23 |
24 | if __name__ == "__main__":
25 | list_namespaces_fmt()
26 | list_workgroups_fmt()
27 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/redshift_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 | @boto_response_formatter(service_name="redshift", function_name="describe_clusters", format_type="csv", output_to="file",pagination="True" )
5 | def describe_clusters_fmt():
6 | client = boto3.client('redshift')
7 | paginator = client.get_paginator('describe_clusters')
8 | result = []
9 | for page in paginator.paginate():
10 | result.append(page)
11 | return result
12 |
13 |
14 | if __name__ == "__main__":
15 | describe_clusters_fmt()
16 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/route53_usage.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import boto3
3 | from boto_formatter.core_formatter import boto_response_formatter
4 |
5 |
6 |
7 |
8 | @boto_response_formatter(service_name="route53", function_name="list_hosted_zones", format_type="csv", output_to="file",pagination="yes")
9 | def list_hosted_zones_fmt():
10 | client = boto3.client('route53')
11 | paginator = client.get_paginator('list_hosted_zones')
12 | result = []
13 | for page in paginator.paginate():
14 | result.append(page)
15 | return result
16 |
17 |
18 | @boto_response_formatter(service_name="route53", function_name="list_hosted_zones_by_vpc", format_type="csv", output_to="file")
19 | def list_hosted_zones_by_vpc_fmt():
20 | client = boto3.client('route53')
21 |
22 | VPCId = ""
23 | VPCRegion = "us-east-1"
24 | result = client.list_hosted_zones_by_vpc(VPCId=VPCId, VPCRegion=VPCRegion)
25 | return result
26 |
27 | @boto_response_formatter(service_name="route53", function_name="list_cidr_blocks", format_type="csv", output_to="file",pagination="yes")
28 | def list_cidr_blocks_fmt():
29 | client = boto3.client('route53')
30 | paginator = client.get_paginator('list_cidr_blocks')
31 | result = []
32 | #CollectionId The UUID of the CIDR collection.
33 | pagination_attributes = {
34 | "CollectionId": "dfdf",
35 | }
36 | for page in paginator.paginate(**pagination_attributes):
37 | result.append(page)
38 | return result
39 |
40 | if __name__ == "__main__":
41 | list_hosted_zones_fmt()
42 | list_hosted_zones_by_vpc_fmt()
43 | list_cidr_blocks_fmt()
44 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/s3_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 | @boto_response_formatter(service_name="s3", function_name="list_buckets", format_type="csv", output_to="file")
5 | def list_buckets_fmt():
6 | client = boto3.client('s3')
7 | result = client.list_buckets()
8 | return result
9 |
10 | @boto_response_formatter(service_name="s3", function_name="list_objects_v2", format_type="csv", output_to="file" ,pagination="True")
11 | def list_objects_v2_fmt():
12 | client = boto3.client('s3')
13 | paginator = client.get_paginator('list_objects_v2')
14 | Bucket = ""
15 | result = []
16 | for page in paginator.paginate(Bucket=Bucket):
17 | result.append(page)
18 | return result
19 |
20 |
21 | if __name__ == "__main__":
22 | #list_buckets_fmt()
23 | list_buckets_fmt()
24 | #list_objects_v2_fmt()
--------------------------------------------------------------------------------
/tests/core_formatter_usages/sns_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="sns", function_name="list_subscriptions", format_type="csv", output_to="file",pagination="True" )
6 | def list_subscriptions_fmt():
7 | client = boto3.client('sns')
8 | paginator = client.get_paginator('list_subscriptions')
9 | result = []
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | @boto_response_formatter(service_name="sns", function_name="list_topics", format_type="csv", output_to="file",pagination="True" )
16 | def list_topics_fmt():
17 | client = boto3.client('sns')
18 | paginator = client.get_paginator('list_topics')
19 | result = []
20 | for page in paginator.paginate():
21 | result.append(page)
22 | return result
23 |
24 |
25 |
26 |
27 | if __name__ == "__main__":
28 | list_subscriptions_fmt()
29 | list_topics_fmt()
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/tests/core_formatter_usages/sqs_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.core_formatter import boto_response_formatter
3 |
4 |
5 | @boto_response_formatter(service_name="sqs", function_name="list_queues", format_type="csv", output_to="file",pagination="True" )
6 | def list_queues_fmt():
7 | client = boto3.client('sqs')
8 | paginator = client.get_paginator('list_queues')
9 | result = []
10 | for page in paginator.paginate():
11 | result.append(page)
12 | return result
13 |
14 |
15 | if __name__ == "__main__":
16 | list_queues_fmt()
17 |
--------------------------------------------------------------------------------
/tests/s3_inventory_usage.py:
--------------------------------------------------------------------------------
1 | import boto3
2 | from boto_formatter.boto_magic_formatter import boto_magic_formatter
3 | from boto_formatter.boto_magic_formatter import boto_magic_save_file
4 |
5 | # Generic function returns the flattend JSON list
6 | @boto_magic_formatter()
7 | def list_resources(_session, service_name, function_name, **kwargs):
8 | result = None
9 | return result
10 |
11 | # Boto magic utility function to save the file.
12 | @boto_magic_save_file(format_type="csv",file_name ="list_bucket_inventory_configurations")
13 | def save_file(result):
14 | return result
15 |
16 | if __name__ == "__main__":
17 | #list_bucket_analytics_configurations()
18 | _session = boto3.session.Session()
19 | # Step 1 : Get List of buckets
20 | resource_list = list_resources(_session, "s3", "list_buckets")
21 | consolidated_list = []
22 | # Step 2 : Iterate over each bucket and get the inventory configurations
23 | for resource in resource_list:
24 | try:
25 | attributes = {"Bucket": resource["Name"]}
26 | print("Bucket : {}".format(resource["Name"]))
27 | #Step 2-A : Ingest prefix column for source bucket name
28 | prefix_columns = {"prefix_columns": {"SourceBucketName":resource["Name"]}}
29 | # Step 2-B : Get inventory configuration for each bucket and update the consolidated list.
30 | consolidated_list.extend(list_resources(_session, "s3", "list_bucket_inventory_configurations", attributes=attributes, prefix_columns=prefix_columns))
31 | except Exception as e:
32 | print(e)
33 | pass
34 | #Step 3 : Save consolidate file
35 | save_file(consolidated_list)
36 |
37 |
38 |
--------------------------------------------------------------------------------