aceapi-v2-client 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. aceapi_v2_client-2.0.0/.gitignore +20 -0
  2. aceapi_v2_client-2.0.0/LICENSE +201 -0
  3. aceapi_v2_client-2.0.0/PKG-INFO +192 -0
  4. aceapi_v2_client-2.0.0/README.md +164 -0
  5. aceapi_v2_client-2.0.0/aceapi_v2_client/__init__.py +8 -0
  6. aceapi_v2_client-2.0.0/aceapi_v2_client/api/__init__.py +1 -0
  7. aceapi_v2_client-2.0.0/aceapi_v2_client/api/alerts/__init__.py +1 -0
  8. aceapi_v2_client-2.0.0/aceapi_v2_client/api/alerts/bulk_add_observable_alerts_bulk_add_observable_post.py +174 -0
  9. aceapi_v2_client-2.0.0/aceapi_v2_client/api/alerts/download_alert_alerts_alert_uuid_download_get.py +167 -0
  10. aceapi_v2_client-2.0.0/aceapi_v2_client/api/alerts/view_alert_logs_alerts_alert_uuid_logs_get.py +200 -0
  11. aceapi_v2_client-2.0.0/aceapi_v2_client/api/authentication/__init__.py +1 -0
  12. aceapi_v2_client-2.0.0/aceapi_v2_client/api/authentication/login_for_access_token_auth_token_post.py +187 -0
  13. aceapi_v2_client-2.0.0/aceapi_v2_client/api/authentication/refresh_access_token_auth_refresh_post.py +182 -0
  14. aceapi_v2_client-2.0.0/aceapi_v2_client/api/common/__init__.py +1 -0
  15. aceapi_v2_client-2.0.0/aceapi_v2_client/api/common/ping_common_ping_get.py +128 -0
  16. aceapi_v2_client-2.0.0/aceapi_v2_client/api/common/supported_api_version_common_supported_api_version_get.py +128 -0
  17. aceapi_v2_client-2.0.0/aceapi_v2_client/api/common/valid_companies_common_valid_companies_get.py +128 -0
  18. aceapi_v2_client-2.0.0/aceapi_v2_client/api/common/valid_directives_common_valid_directives_get.py +130 -0
  19. aceapi_v2_client-2.0.0/aceapi_v2_client/api/common/valid_observables_common_valid_observables_get.py +130 -0
  20. aceapi_v2_client-2.0.0/aceapi_v2_client/api/events/__init__.py +1 -0
  21. aceapi_v2_client-2.0.0/aceapi_v2_client/api/events/export_events_events_export_get.py +192 -0
  22. aceapi_v2_client-2.0.0/aceapi_v2_client/api/events/open_events_events_open_get.py +128 -0
  23. aceapi_v2_client-2.0.0/aceapi_v2_client/api/events/update_event_status_events_event_id_patch.py +182 -0
  24. aceapi_v2_client-2.0.0/aceapi_v2_client/api/health/__init__.py +1 -0
  25. aceapi_v2_client-2.0.0/aceapi_v2_client/api/health/ping_health_ping_get.py +136 -0
  26. aceapi_v2_client-2.0.0/aceapi_v2_client/api/nodes/__init__.py +1 -0
  27. aceapi_v2_client-2.0.0/aceapi_v2_client/api/nodes/drain_node_nodes_node_id_drain_post.py +173 -0
  28. aceapi_v2_client-2.0.0/aceapi_v2_client/api/nodes/get_node_nodes_node_id_get.py +161 -0
  29. aceapi_v2_client-2.0.0/aceapi_v2_client/api/nodes/list_nodes_nodes_get.py +128 -0
  30. aceapi_v2_client-2.0.0/aceapi_v2_client/api/nodes/resume_node_nodes_node_id_resume_post.py +169 -0
  31. aceapi_v2_client-2.0.0/aceapi_v2_client/api/observables/__init__.py +1 -0
  32. aceapi_v2_client-2.0.0/aceapi_v2_client/api/observables/create_comment_observable_comments_post.py +166 -0
  33. aceapi_v2_client-2.0.0/aceapi_v2_client/api/observables/delete_comment_observable_comments_comment_id_delete.py +159 -0
  34. aceapi_v2_client-2.0.0/aceapi_v2_client/api/observables/list_comments_observable_comments_observable_id_get.py +163 -0
  35. aceapi_v2_client-2.0.0/aceapi_v2_client/api/observables/list_observable_types_observable_types_get.py +144 -0
  36. aceapi_v2_client-2.0.0/aceapi_v2_client/api/observables/set_interesting_observables_interesting_patch.py +191 -0
  37. aceapi_v2_client-2.0.0/aceapi_v2_client/api/observables/update_comment_observable_comments_comment_id_patch.py +182 -0
  38. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/__init__.py +1 -0
  39. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/create_threat_threats_post.py +166 -0
  40. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/create_threat_type_threat_types_post.py +166 -0
  41. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/delete_threat_threats_delete.py +179 -0
  42. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/delete_threat_type_threat_types_threat_type_id_delete.py +159 -0
  43. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/get_threat_type_threat_types_threat_type_id_get.py +161 -0
  44. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/list_threat_types_threat_types_get.py +128 -0
  45. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/list_threats_threats_get.py +171 -0
  46. aceapi_v2_client-2.0.0/aceapi_v2_client/api/threats/update_threat_type_threat_types_threat_type_id_patch.py +182 -0
  47. aceapi_v2_client-2.0.0/aceapi_v2_client/auth.py +56 -0
  48. aceapi_v2_client-2.0.0/aceapi_v2_client/client.py +282 -0
  49. aceapi_v2_client-2.0.0/aceapi_v2_client/errors.py +16 -0
  50. aceapi_v2_client-2.0.0/aceapi_v2_client/models/__init__.py +87 -0
  51. aceapi_v2_client-2.0.0/aceapi_v2_client/models/body_login_for_access_token_auth_token_post.py +140 -0
  52. aceapi_v2_client-2.0.0/aceapi_v2_client/models/bulk_add_observable_request.py +110 -0
  53. aceapi_v2_client-2.0.0/aceapi_v2_client/models/bulk_add_observable_result.py +107 -0
  54. aceapi_v2_client-2.0.0/aceapi_v2_client/models/bulk_add_observable_result_failed_details.py +47 -0
  55. aceapi_v2_client-2.0.0/aceapi_v2_client/models/collector_status_read.py +86 -0
  56. aceapi_v2_client-2.0.0/aceapi_v2_client/models/company_read.py +69 -0
  57. aceapi_v2_client-2.0.0/aceapi_v2_client/models/event_read.py +84 -0
  58. aceapi_v2_client-2.0.0/aceapi_v2_client/models/export_format.py +8 -0
  59. aceapi_v2_client-2.0.0/aceapi_v2_client/models/health_response.py +62 -0
  60. aceapi_v2_client-2.0.0/aceapi_v2_client/models/http_validation_error.py +79 -0
  61. aceapi_v2_client-2.0.0/aceapi_v2_client/models/list_response_company_read.py +75 -0
  62. aceapi_v2_client-2.0.0/aceapi_v2_client/models/list_response_event_read.py +75 -0
  63. aceapi_v2_client-2.0.0/aceapi_v2_client/models/list_response_named_description_read.py +75 -0
  64. aceapi_v2_client-2.0.0/aceapi_v2_client/models/list_response_node_read.py +75 -0
  65. aceapi_v2_client-2.0.0/aceapi_v2_client/models/list_response_observable_comment_read.py +75 -0
  66. aceapi_v2_client-2.0.0/aceapi_v2_client/models/list_response_observable_type_read.py +75 -0
  67. aceapi_v2_client-2.0.0/aceapi_v2_client/models/list_response_threat_read.py +75 -0
  68. aceapi_v2_client-2.0.0/aceapi_v2_client/models/list_response_threat_type_read.py +75 -0
  69. aceapi_v2_client-2.0.0/aceapi_v2_client/models/named_description_read.py +69 -0
  70. aceapi_v2_client-2.0.0/aceapi_v2_client/models/node_read.py +163 -0
  71. aceapi_v2_client-2.0.0/aceapi_v2_client/models/observable_comment_create.py +77 -0
  72. aceapi_v2_client-2.0.0/aceapi_v2_client/models/observable_comment_read.py +102 -0
  73. aceapi_v2_client-2.0.0/aceapi_v2_client/models/observable_comment_update.py +61 -0
  74. aceapi_v2_client-2.0.0/aceapi_v2_client/models/observable_type_read.py +62 -0
  75. aceapi_v2_client-2.0.0/aceapi_v2_client/models/ping_response.py +61 -0
  76. aceapi_v2_client-2.0.0/aceapi_v2_client/models/refresh_request.py +62 -0
  77. aceapi_v2_client-2.0.0/aceapi_v2_client/models/set_interesting_observables_interesting_patch_response_set_interesting_observables_interesting_patch.py +50 -0
  78. aceapi_v2_client-2.0.0/aceapi_v2_client/models/set_interesting_request.py +77 -0
  79. aceapi_v2_client-2.0.0/aceapi_v2_client/models/status_update.py +62 -0
  80. aceapi_v2_client-2.0.0/aceapi_v2_client/models/supported_api_version_response.py +61 -0
  81. aceapi_v2_client-2.0.0/aceapi_v2_client/models/threat_create.py +69 -0
  82. aceapi_v2_client-2.0.0/aceapi_v2_client/models/threat_read.py +77 -0
  83. aceapi_v2_client-2.0.0/aceapi_v2_client/models/threat_type_create.py +61 -0
  84. aceapi_v2_client-2.0.0/aceapi_v2_client/models/threat_type_read.py +69 -0
  85. aceapi_v2_client-2.0.0/aceapi_v2_client/models/threat_type_update.py +73 -0
  86. aceapi_v2_client-2.0.0/aceapi_v2_client/models/token.py +81 -0
  87. aceapi_v2_client-2.0.0/aceapi_v2_client/models/validation_error.py +123 -0
  88. aceapi_v2_client-2.0.0/aceapi_v2_client/models/validation_error_context.py +47 -0
  89. aceapi_v2_client-2.0.0/aceapi_v2_client/py.typed +0 -0
  90. aceapi_v2_client-2.0.0/aceapi_v2_client/types.py +54 -0
  91. aceapi_v2_client-2.0.0/openapi-python-client-config.yaml +7 -0
  92. aceapi_v2_client-2.0.0/openapi.json +1 -0
  93. aceapi_v2_client-2.0.0/pyproject.toml +58 -0
  94. aceapi_v2_client-2.0.0/requirements-dev.txt +12 -0
  95. aceapi_v2_client-2.0.0/requirements.txt +5 -0
  96. aceapi_v2_client-2.0.0/scripts/regenerate.sh +92 -0
  97. aceapi_v2_client-2.0.0/tests/test_smoke.py +61 -0
@@ -0,0 +1,20 @@
1
+ # build artifacts
2
+ build/
3
+ dist/
4
+ *.egg-info/
5
+ .eggs/
6
+
7
+ # python
8
+ __pycache__/
9
+ *.py[cod]
10
+ *.so
11
+ .venv/
12
+ venv/
13
+
14
+ # tooling caches
15
+ .ruff_cache/
16
+ .pytest_cache/
17
+ .mypy_cache/
18
+
19
+ # regeneration scratch dir (scripts/regenerate.sh)
20
+ .regen/
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.4
2
+ Name: aceapi-v2-client
3
+ Version: 2.0.0
4
+ Summary: Python client library for the ACE (Analysis Correlation Engine) API v2
5
+ Project-URL: Homepage, https://github.com/ACE-Collective/ace
6
+ Project-URL: Repository, https://github.com/ACE-Collective/ace
7
+ Project-URL: Issues, https://github.com/ACE-Collective/ace/issues
8
+ Author: ACE Collective
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: ace,analysis-correlation-engine,api-client,security
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.9
24
+ Requires-Dist: attrs>=22.2.0
25
+ Requires-Dist: httpx<0.29.0,>=0.23.0
26
+ Requires-Dist: python-dateutil>=2.8.0
27
+ Description-Content-Type: text/markdown
28
+
29
+ # aceapi-v2-client
30
+
31
+ A Python client library for the **ACE (Analysis Correlation Engine) API v2**.
32
+
33
+ The client is generated from the API's OpenAPI schema with
34
+ [openapi-python-client](https://github.com/openapi-generators/openapi-python-client),
35
+ so every endpoint and model is fully typed. A small hand-written `auth` module
36
+ adds convenience helpers for ACE's API-key authentication.
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ pip install aceapi-v2-client
42
+ ```
43
+
44
+ Or install from a checkout of this directory:
45
+
46
+ ```bash
47
+ pip install .
48
+ ```
49
+
50
+ Requires Python 3.9+.
51
+
52
+ ## Quickstart (API key)
53
+
54
+ ACE's primary machine-to-machine authentication is an API key sent in the
55
+ `x-ace-auth` header. Use the `authenticated_client` helper to build a client
56
+ with that header pre-populated:
57
+
58
+ ```python
59
+ from aceapi_v2_client.auth import authenticated_client
60
+ from aceapi_v2_client.api.common import ping_common_ping_get
61
+ from aceapi_v2_client.api.observables import (
62
+ list_observable_types_observable_types_get,
63
+ )
64
+
65
+ client = authenticated_client(
66
+ base_url="https://localhost:8443/api/v2",
67
+ api_key="YOUR-API-KEY",
68
+ verify_ssl=False, # development instances use a self-signed certificate
69
+ )
70
+
71
+ # a simple authenticated health check
72
+ pong = ping_common_ping_get.sync(client=client)
73
+ print(pong.result) # "pong"
74
+
75
+ # call a data endpoint — responses are parsed into typed models
76
+ types = list_observable_types_observable_types_get.sync(client=client)
77
+ print(types)
78
+ ```
79
+
80
+ Every endpoint module under `aceapi_v2_client.api.*` exposes four functions:
81
+
82
+ | function | returns |
83
+ | ----------------- | -------------------------------- |
84
+ | `sync(...)` | the parsed body (or `None`) |
85
+ | `sync_detailed(...)` | a `Response` with status + parsed body |
86
+ | `asyncio(...)` | the parsed body, async |
87
+ | `asyncio_detailed(...)` | a `Response`, async |
88
+
89
+ All take `client=` as a keyword argument plus any path/query/body parameters
90
+ the operation defines.
91
+
92
+ ### Async usage
93
+
94
+ ```python
95
+ import asyncio
96
+ from aceapi_v2_client.auth import authenticated_client
97
+ from aceapi_v2_client.api.common import ping_common_ping_get
98
+
99
+ client = authenticated_client("https://localhost:8443/api/v2", "YOUR-API-KEY",
100
+ verify_ssl=False)
101
+
102
+ async def main():
103
+ async with client as c:
104
+ print(await ping_common_ping_get.asyncio(client=c))
105
+
106
+ asyncio.run(main())
107
+ ```
108
+
109
+ ## Authentication with a JWT token
110
+
111
+ ACE also supports user login via OAuth2 password flow. Obtain a token from the
112
+ `/auth/token` endpoint, then use the `token_client` helper:
113
+
114
+ ```python
115
+ from aceapi_v2_client.auth import token_client
116
+
117
+ client = token_client(
118
+ base_url="https://localhost:8443/api/v2",
119
+ access_token="eyJhbGci...", # from POST /auth/token
120
+ verify_ssl=False,
121
+ )
122
+ ```
123
+
124
+ `token_client` sends the token as `Authorization: Bearer <token>`.
125
+
126
+ ## Base URL and TLS notes
127
+
128
+ - **The base URL must include the `/api/v2` prefix.** The generated client
129
+ appends operation paths (e.g. `/common/ping`) directly to `base_url`.
130
+ - From inside the docker compose network: `https://ace-http/api/v2`
131
+ - From the docker host: `https://localhost:8443/api/v2`
132
+ - Development instances serve a **self-signed certificate**. Pass
133
+ `verify_ssl=False` (as above) or point `verify_ssl` at a CA bundle path for
134
+ production.
135
+
136
+ ## Keeping the client up to date
137
+
138
+ The generated code is committed to this repository. When the ACE API v2 changes,
139
+ regenerate it from the live schema:
140
+
141
+ ```bash
142
+ # against the default instance (https://ace-http/api/v2/openapi.json)
143
+ scripts/regenerate.sh
144
+
145
+ # or against a specific instance
146
+ scripts/regenerate.sh https://localhost:8443/api/v2/openapi.json
147
+ ```
148
+
149
+ The script:
150
+
151
+ 1. fetches the latest `openapi.json` into this directory (the build-time source
152
+ of truth),
153
+ 2. installs `openapi-python-client` into a throwaway virtualenv (so it never
154
+ touches your main environment),
155
+ 3. regenerates the package, preserving the hand-maintained files
156
+ (`aceapi_v2_client/auth.py` and `aceapi_v2_client/py.typed`).
157
+
158
+ After running it:
159
+
160
+ 1. **Review the diff**: `git diff aceapi_v2_client/`
161
+ 2. **Bump the version** if the API changed — update `version` in
162
+ `pyproject.toml` and `package_version_override` in
163
+ `openapi-python-client-config.yaml`. The client version mirrors the API's
164
+ major version (`2.x.y`); bump the patch/minor for client-only changes.
165
+ 3. **Rebuild and verify** (below).
166
+
167
+ > Only `auth.py` and `py.typed` are hand-maintained. Do not add other custom
168
+ > code inside `aceapi_v2_client/` — it would be overwritten on regeneration.
169
+
170
+ ## Building and publishing to PyPI
171
+
172
+ ```bash
173
+ pip install -r requirements-dev.txt
174
+ python -m build # produces dist/*.whl and dist/*.tar.gz
175
+ twine check dist/* # validate metadata for PyPI
176
+ twine upload dist/* # publish (requires PyPI credentials)
177
+ ```
178
+
179
+ ## Running the smoke test
180
+
181
+ The smoke test only runs when pointed at a live instance:
182
+
183
+ ```bash
184
+ ACE_API_BASE_URL=https://ace-http/api/v2 \
185
+ ACE_API_KEY=YOUR-API-KEY \
186
+ ACE_API_VERIFY_SSL=false \
187
+ pytest tests/test_smoke.py -v
188
+ ```
189
+
190
+ ## License
191
+
192
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,164 @@
1
+ # aceapi-v2-client
2
+
3
+ A Python client library for the **ACE (Analysis Correlation Engine) API v2**.
4
+
5
+ The client is generated from the API's OpenAPI schema with
6
+ [openapi-python-client](https://github.com/openapi-generators/openapi-python-client),
7
+ so every endpoint and model is fully typed. A small hand-written `auth` module
8
+ adds convenience helpers for ACE's API-key authentication.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ pip install aceapi-v2-client
14
+ ```
15
+
16
+ Or install from a checkout of this directory:
17
+
18
+ ```bash
19
+ pip install .
20
+ ```
21
+
22
+ Requires Python 3.9+.
23
+
24
+ ## Quickstart (API key)
25
+
26
+ ACE's primary machine-to-machine authentication is an API key sent in the
27
+ `x-ace-auth` header. Use the `authenticated_client` helper to build a client
28
+ with that header pre-populated:
29
+
30
+ ```python
31
+ from aceapi_v2_client.auth import authenticated_client
32
+ from aceapi_v2_client.api.common import ping_common_ping_get
33
+ from aceapi_v2_client.api.observables import (
34
+ list_observable_types_observable_types_get,
35
+ )
36
+
37
+ client = authenticated_client(
38
+ base_url="https://localhost:8443/api/v2",
39
+ api_key="YOUR-API-KEY",
40
+ verify_ssl=False, # development instances use a self-signed certificate
41
+ )
42
+
43
+ # a simple authenticated health check
44
+ pong = ping_common_ping_get.sync(client=client)
45
+ print(pong.result) # "pong"
46
+
47
+ # call a data endpoint — responses are parsed into typed models
48
+ types = list_observable_types_observable_types_get.sync(client=client)
49
+ print(types)
50
+ ```
51
+
52
+ Every endpoint module under `aceapi_v2_client.api.*` exposes four functions:
53
+
54
+ | function | returns |
55
+ | ----------------- | -------------------------------- |
56
+ | `sync(...)` | the parsed body (or `None`) |
57
+ | `sync_detailed(...)` | a `Response` with status + parsed body |
58
+ | `asyncio(...)` | the parsed body, async |
59
+ | `asyncio_detailed(...)` | a `Response`, async |
60
+
61
+ All take `client=` as a keyword argument plus any path/query/body parameters
62
+ the operation defines.
63
+
64
+ ### Async usage
65
+
66
+ ```python
67
+ import asyncio
68
+ from aceapi_v2_client.auth import authenticated_client
69
+ from aceapi_v2_client.api.common import ping_common_ping_get
70
+
71
+ client = authenticated_client("https://localhost:8443/api/v2", "YOUR-API-KEY",
72
+ verify_ssl=False)
73
+
74
+ async def main():
75
+ async with client as c:
76
+ print(await ping_common_ping_get.asyncio(client=c))
77
+
78
+ asyncio.run(main())
79
+ ```
80
+
81
+ ## Authentication with a JWT token
82
+
83
+ ACE also supports user login via OAuth2 password flow. Obtain a token from the
84
+ `/auth/token` endpoint, then use the `token_client` helper:
85
+
86
+ ```python
87
+ from aceapi_v2_client.auth import token_client
88
+
89
+ client = token_client(
90
+ base_url="https://localhost:8443/api/v2",
91
+ access_token="eyJhbGci...", # from POST /auth/token
92
+ verify_ssl=False,
93
+ )
94
+ ```
95
+
96
+ `token_client` sends the token as `Authorization: Bearer <token>`.
97
+
98
+ ## Base URL and TLS notes
99
+
100
+ - **The base URL must include the `/api/v2` prefix.** The generated client
101
+ appends operation paths (e.g. `/common/ping`) directly to `base_url`.
102
+ - From inside the docker compose network: `https://ace-http/api/v2`
103
+ - From the docker host: `https://localhost:8443/api/v2`
104
+ - Development instances serve a **self-signed certificate**. Pass
105
+ `verify_ssl=False` (as above) or point `verify_ssl` at a CA bundle path for
106
+ production.
107
+
108
+ ## Keeping the client up to date
109
+
110
+ The generated code is committed to this repository. When the ACE API v2 changes,
111
+ regenerate it from the live schema:
112
+
113
+ ```bash
114
+ # against the default instance (https://ace-http/api/v2/openapi.json)
115
+ scripts/regenerate.sh
116
+
117
+ # or against a specific instance
118
+ scripts/regenerate.sh https://localhost:8443/api/v2/openapi.json
119
+ ```
120
+
121
+ The script:
122
+
123
+ 1. fetches the latest `openapi.json` into this directory (the build-time source
124
+ of truth),
125
+ 2. installs `openapi-python-client` into a throwaway virtualenv (so it never
126
+ touches your main environment),
127
+ 3. regenerates the package, preserving the hand-maintained files
128
+ (`aceapi_v2_client/auth.py` and `aceapi_v2_client/py.typed`).
129
+
130
+ After running it:
131
+
132
+ 1. **Review the diff**: `git diff aceapi_v2_client/`
133
+ 2. **Bump the version** if the API changed — update `version` in
134
+ `pyproject.toml` and `package_version_override` in
135
+ `openapi-python-client-config.yaml`. The client version mirrors the API's
136
+ major version (`2.x.y`); bump the patch/minor for client-only changes.
137
+ 3. **Rebuild and verify** (below).
138
+
139
+ > Only `auth.py` and `py.typed` are hand-maintained. Do not add other custom
140
+ > code inside `aceapi_v2_client/` — it would be overwritten on regeneration.
141
+
142
+ ## Building and publishing to PyPI
143
+
144
+ ```bash
145
+ pip install -r requirements-dev.txt
146
+ python -m build # produces dist/*.whl and dist/*.tar.gz
147
+ twine check dist/* # validate metadata for PyPI
148
+ twine upload dist/* # publish (requires PyPI credentials)
149
+ ```
150
+
151
+ ## Running the smoke test
152
+
153
+ The smoke test only runs when pointed at a live instance:
154
+
155
+ ```bash
156
+ ACE_API_BASE_URL=https://ace-http/api/v2 \
157
+ ACE_API_KEY=YOUR-API-KEY \
158
+ ACE_API_VERIFY_SSL=false \
159
+ pytest tests/test_smoke.py -v
160
+ ```
161
+
162
+ ## License
163
+
164
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,8 @@
1
+ """A client library for accessing ACE API v2"""
2
+
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""