ibm-secrets-manager-instance-management-sdk 2.0.1__py3-none-any.whl
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.
- ibm_secrets_manager_instance_management_sdk-2.0.1.dist-info/METADATA +159 -0
- ibm_secrets_manager_instance_management_sdk-2.0.1.dist-info/RECORD +8 -0
- ibm_secrets_manager_instance_management_sdk-2.0.1.dist-info/WHEEL +4 -0
- ibm_secrets_manager_instance_management_sdk-2.0.1.dist-info/licenses/LICENSE +201 -0
- ibm_secrets_manager_sdk_instance_management/__init__.py +0 -0
- ibm_secrets_manager_sdk_instance_management/common.py +11 -0
- ibm_secrets_manager_sdk_instance_management/secrets_manager_instance_management_v2.py +755 -0
- ibm_secrets_manager_sdk_instance_management/version.py +1 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ibm-secrets-manager-instance-management-sdk
|
|
3
|
+
Version: 2.0.1
|
|
4
|
+
Summary: IBM Cloud Secrets Manager instance management Python SDK
|
|
5
|
+
Project-URL: Repository, https://github.com/IBM/secrets-manager-management-python-sdk
|
|
6
|
+
Project-URL: Documentation, https://cloud.ibm.com/apidocs/secrets-manager
|
|
7
|
+
Project-URL: Issues, https://github.com/IBM/secrets-manager-management-python-sdk/issues
|
|
8
|
+
Author-email: IBM <secrets.automation@ibm.com>
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: cloud,control plane,ibm,ibm cloud services,instance management,secrets manager
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
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: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Requires-Dist: ibm-cloud-sdk-core<4.0.0,>=3.24.4
|
|
26
|
+
Requires-Dist: python-dateutil<3.0.0,>=2.5.3
|
|
27
|
+
Requires-Dist: requests<3.0.0,>=2.32.4
|
|
28
|
+
Requires-Dist: urllib3<3.0.0,>=2.6.3
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: black<26.3.2,>=26.3.1; extra == 'dev'
|
|
31
|
+
Requires-Dist: coverage<8.0.0,>=7.3.2; extra == 'dev'
|
|
32
|
+
Requires-Dist: pylint<4.1.0,>=4.0.5; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-cov<7.2.0,>=7.1.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-rerunfailures>=3.1; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest<9.1.0,>=9.0.2; extra == 'dev'
|
|
36
|
+
Requires-Dist: python-dotenv>=0.19.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: responses<1.0.0,>=0.23.3; extra == 'dev'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# IBM Cloud Secrets Manager Management Python SDK
|
|
41
|
+
A Python client library to interact with the IBM Cloud® Secrets Manager Instance Management APIs.
|
|
42
|
+
|
|
43
|
+
> **Important:** This SDK is for use with instances of the IBM Cloud Secrets Manager **Vault Enterprise plan only**. It is not compatible with other Secrets Manager plans.
|
|
44
|
+
|
|
45
|
+
<details>
|
|
46
|
+
<summary>Table of Contents</summary>
|
|
47
|
+
|
|
48
|
+
* [Overview](#overview)
|
|
49
|
+
* [Prerequisites](#prerequisites)
|
|
50
|
+
* [Installation](#installation)
|
|
51
|
+
* [Authentication](#authentication)
|
|
52
|
+
* [Using the SDK](#using-the-sdk)
|
|
53
|
+
* [Issues](#issues)
|
|
54
|
+
* [Contributing](#contributing)
|
|
55
|
+
* [License](#license)
|
|
56
|
+
|
|
57
|
+
</details>
|
|
58
|
+
|
|
59
|
+
## Overview
|
|
60
|
+
The IBM Cloud Secrets Manager Management Python SDK allows developers to programmatically interact with the following IBM Cloud services:
|
|
61
|
+
|
|
62
|
+
| Service name | Imported class name |
|
|
63
|
+
|-------------------------------------------|-----------------------------------------|
|
|
64
|
+
| Secrets Manager Management | SecretsManagerInstanceManagementV2 |
|
|
65
|
+
|
|
66
|
+
## Prerequisites
|
|
67
|
+
- An [IBM Cloud account](https://cloud.ibm.com/registration).
|
|
68
|
+
- A [Secrets Manager service instance](https://cloud.ibm.com/catalog/services/secrets-manager) with the **Vault Enterprise plan**.
|
|
69
|
+
- An [IBM Cloud API key](https://cloud.ibm.com/iam/apikeys) that allows the SDK to access your account.
|
|
70
|
+
- Python 3.9 or above.
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
To install, use `pip` or `easy_install`:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pip install --upgrade "ibm-secrets-manager-instance-management-sdk"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
or
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
easy_install --upgrade "ibm-secrets-manager-instance-management-sdk"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Authentication
|
|
86
|
+
Secrets Manager uses token-based Identity and Access Management (IAM) authentication.
|
|
87
|
+
|
|
88
|
+
With IAM authentication, you supply an API key that is used to generate an access token. Then, the access token is included in each API request to Secrets Manager. Access tokens are valid for a limited amount of time and must be regenerated.
|
|
89
|
+
Authentication for this SDK is accomplished by using [IAM authenticators](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md#authentication). Import authenticators from `ibm_cloud_sdk_core.authenticators`.
|
|
90
|
+
|
|
91
|
+
### Examples
|
|
92
|
+
#### Programmatic credentials
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
|
|
96
|
+
|
|
97
|
+
secretsManagerInstanceManagement = SecretsManagerInstanceManagementV2(
|
|
98
|
+
authenticator=IAMAuthenticator(apikey='<IBM_CLOUD_API_KEY>')
|
|
99
|
+
)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
To learn more about IAM authenticators and how to use them in your Python application, see the [IBM Python SDK Core documentation](https://github.com/IBM/python-sdk-core/blob/master/Authentication.md).
|
|
103
|
+
|
|
104
|
+
## Using the SDK
|
|
105
|
+
|
|
106
|
+
### Basic usage
|
|
107
|
+
|
|
108
|
+
- Use the `set_service_url` method to set the endpoint URL that is specific to your Secrets Manager service instance. To find your endpoint URL, you can copy it from the **Endpoints** section on the **Overview** page in the Secrets Manager UI.
|
|
109
|
+
|
|
110
|
+
#### Examples
|
|
111
|
+
|
|
112
|
+
Construct a service client and use it to generate an admin token and get instance details.
|
|
113
|
+
|
|
114
|
+
Here's an example `secrets_manager_instance_management.py` file:
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
from ibm_cloud_sdk_core.authenticators.iam_authenticator import IAMAuthenticator
|
|
118
|
+
from ibm_secrets_manager_instance_management_sdk.secrets_manager_instance_management_v2 import *
|
|
119
|
+
|
|
120
|
+
secretsManagerInstanceManagement = SecretsManagerInstanceManagementV2(
|
|
121
|
+
authenticator=IAMAuthenticator(apikey='<IBM_CLOUD_API_KEY>')
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
secretsManagerInstanceManagement.set_service_url('<SERVICE_URL>')
|
|
125
|
+
|
|
126
|
+
# Generate admin token
|
|
127
|
+
response = secretsManagerInstanceManagement.admin_token_generate(
|
|
128
|
+
instance_crn='<INSTANCE_CRN>'
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
print('Admin token generated!')
|
|
132
|
+
|
|
133
|
+
# Get instance details
|
|
134
|
+
response = secretsManagerInstanceManagement.instance_details(
|
|
135
|
+
instance_crn='<INSTANCE_CRN>'
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
print('Instance details:')
|
|
139
|
+
print(response.result)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Replace the `apikey`, `SERVICE_URL`, and `INSTANCE_CRN` values. Then use the `python secrets_manager_instance_management.py` command to run your
|
|
143
|
+
application.
|
|
144
|
+
|
|
145
|
+
For more information and IBM Cloud SDK usage examples for Python, see
|
|
146
|
+
the [IBM Cloud SDK Common documentation](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md).
|
|
147
|
+
|
|
148
|
+
## Issues
|
|
149
|
+
|
|
150
|
+
If you encounter an issue with the project, you're welcome to submit
|
|
151
|
+
a [bug report](https://github.com/IBM/secrets-manager-management-python-sdk/issues) to help us improve.
|
|
152
|
+
|
|
153
|
+
## Contributing
|
|
154
|
+
|
|
155
|
+
For general contribution guidelines, see [CONTRIBUTING](CONTRIBUTING.md).
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
This SDK project is released under the Apache 2.0 license. The license's full text can be found in [LICENSE](LICENSE).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
ibm_secrets_manager_sdk_instance_management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
ibm_secrets_manager_sdk_instance_management/common.py,sha256=3w6hB31KtvtN09FpeZgkRWCuLNb5z6U4uXMDu_zzvMA,460
|
|
3
|
+
ibm_secrets_manager_sdk_instance_management/secrets_manager_instance_management_v2.py,sha256=4r71xs48WsYNMd3CBVwbgkXkx2fBqqTpep9-3veLs08,27698
|
|
4
|
+
ibm_secrets_manager_sdk_instance_management/version.py,sha256=HVx0XJJ9OYFWBBPBCUFYb8Nm43ChPg9GZLh_dkxh9qI,22
|
|
5
|
+
ibm_secrets_manager_instance_management_sdk-2.0.1.dist-info/METADATA,sha256=tgyBDHtojdlzLNBVKWqSoe2JEjQVYLcaflTJv69a8rY,6502
|
|
6
|
+
ibm_secrets_manager_instance_management_sdk-2.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
ibm_secrets_manager_instance_management_sdk-2.0.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
8
|
+
ibm_secrets_manager_instance_management_sdk-2.0.1.dist-info/RECORD,,
|
|
@@ -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.
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# (C) Copyright IBM Corp. 2024.
|
|
3
|
+
|
|
4
|
+
"""Common functionality for IBM Cloud SDK."""
|
|
5
|
+
|
|
6
|
+
def get_sdk_headers(service_name=None, service_version=None, operation_id=None):
|
|
7
|
+
"""Get SDK specific headers to be included in every API call."""
|
|
8
|
+
return {
|
|
9
|
+
'User-Agent': 'ibm-secrets-manager-vaas-sdk-python/0.0.1',
|
|
10
|
+
'X-SDK-Analytics': f'service_name={service_name};service_version={service_version};operation_id={operation_id}'
|
|
11
|
+
}
|
|
@@ -0,0 +1,755 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# (C) Copyright IBM Corp. 2026.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
# IBM OpenAPI SDK Code Generator Version: 3.114.4-9b56d441-20260612-210048
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
With IBM Cloud® Secrets Manager Instance Management API, you can manage service instances
|
|
21
|
+
of the Vault Dedicated plan. Use the API for the following operations:
|
|
22
|
+
- Get service instance details including cluster state, endpoints, and key management
|
|
23
|
+
service.
|
|
24
|
+
- Generate a Vault admin token for authenticating to your Vault Dedicated cluster.
|
|
25
|
+
- Revoke all active Vault admin tokens.
|
|
26
|
+
|
|
27
|
+
API Version: 2.0.0
|
|
28
|
+
See: https://cloud.ibm.com/docs/secrets-manager
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
from enum import Enum
|
|
32
|
+
from typing import Dict, Optional
|
|
33
|
+
import json
|
|
34
|
+
|
|
35
|
+
from ibm_cloud_sdk_core import BaseService, DetailedResponse
|
|
36
|
+
from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator
|
|
37
|
+
from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment
|
|
38
|
+
|
|
39
|
+
from .common import get_sdk_headers
|
|
40
|
+
|
|
41
|
+
##############################################################################
|
|
42
|
+
# Service
|
|
43
|
+
##############################################################################
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class SecretsManagerInstanceManagementV2(BaseService):
|
|
47
|
+
"""The secrets-manager-instance-management V2 service."""
|
|
48
|
+
|
|
49
|
+
DEFAULT_SERVICE_URL = 'https://us-south.secrets-manager.cloud.ibm.com'
|
|
50
|
+
DEFAULT_SERVICE_NAME = 'secrets_manager_instance_management'
|
|
51
|
+
|
|
52
|
+
PARAMETERIZED_SERVICE_URL = 'https://{region}.secrets-manager.cloud.ibm.com'
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def new_instance(
|
|
56
|
+
cls,
|
|
57
|
+
service_name: str = DEFAULT_SERVICE_NAME,
|
|
58
|
+
) -> 'SecretsManagerInstanceManagementV2':
|
|
59
|
+
"""
|
|
60
|
+
Return a new client for the secrets-manager-instance-management service
|
|
61
|
+
using the specified parameters and external configuration.
|
|
62
|
+
"""
|
|
63
|
+
authenticator = get_authenticator_from_environment(service_name)
|
|
64
|
+
service = cls(
|
|
65
|
+
authenticator
|
|
66
|
+
)
|
|
67
|
+
service.configure_service(service_name)
|
|
68
|
+
return service
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def construct_service_url(
|
|
72
|
+
cls,
|
|
73
|
+
region: str = 'us-south',
|
|
74
|
+
) -> str:
|
|
75
|
+
"""
|
|
76
|
+
Construct a service URL by formatting the parameterized service URL.
|
|
77
|
+
|
|
78
|
+
The parameterized service URL is:
|
|
79
|
+
'https://{region}.secrets-manager.cloud.ibm.com'
|
|
80
|
+
|
|
81
|
+
:param str region: (optional) The region where you provisioned your Vault Dedicated Instance. Available regions: us-south, eu-de, jp-tok
|
|
82
|
+
(default 'us-south')
|
|
83
|
+
:return: The formatted URL with all variable placeholders replaced by values.
|
|
84
|
+
:rtype: str
|
|
85
|
+
"""
|
|
86
|
+
return cls.PARAMETERIZED_SERVICE_URL.format(
|
|
87
|
+
region=region,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
def __init__(
|
|
91
|
+
self,
|
|
92
|
+
authenticator: Authenticator = None,
|
|
93
|
+
) -> None:
|
|
94
|
+
"""
|
|
95
|
+
Construct a new client for the secrets-manager-instance-management service.
|
|
96
|
+
|
|
97
|
+
:param Authenticator authenticator: The authenticator specifies the authentication mechanism.
|
|
98
|
+
Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md
|
|
99
|
+
about initializing the authenticator of your choice.
|
|
100
|
+
"""
|
|
101
|
+
BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator)
|
|
102
|
+
|
|
103
|
+
#########################
|
|
104
|
+
# Tokens
|
|
105
|
+
#########################
|
|
106
|
+
|
|
107
|
+
def create_vault_admintoken(
|
|
108
|
+
self,
|
|
109
|
+
instance_id: str,
|
|
110
|
+
**kwargs,
|
|
111
|
+
) -> DetailedResponse:
|
|
112
|
+
"""
|
|
113
|
+
Generate admin token.
|
|
114
|
+
|
|
115
|
+
Generate a Vault admin token for authenticating to your Vault Dedicated cluster.
|
|
116
|
+
The token is valid for 1 hour and grants administrative privileges. Use only for
|
|
117
|
+
initial setup and cluster management, then revoke immediately.
|
|
118
|
+
|
|
119
|
+
:param str instance_id: The service instance ID.
|
|
120
|
+
:param dict headers: A `dict` containing the request headers
|
|
121
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
122
|
+
:rtype: DetailedResponse with `dict` result representing a `Token` object
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
if not instance_id:
|
|
126
|
+
raise ValueError('instance_id must be provided')
|
|
127
|
+
headers = {}
|
|
128
|
+
sdk_headers = get_sdk_headers(
|
|
129
|
+
service_name=self.DEFAULT_SERVICE_NAME,
|
|
130
|
+
service_version='V2',
|
|
131
|
+
operation_id='create_vault_admintoken',
|
|
132
|
+
)
|
|
133
|
+
headers.update(sdk_headers)
|
|
134
|
+
|
|
135
|
+
if 'headers' in kwargs:
|
|
136
|
+
headers.update(kwargs.get('headers'))
|
|
137
|
+
del kwargs['headers']
|
|
138
|
+
headers['Accept'] = 'application/json'
|
|
139
|
+
|
|
140
|
+
path_param_keys = ['instance_id']
|
|
141
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
142
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
143
|
+
url = '/api/v2/instances/{instance_id}/admintokens'.format(**path_param_dict)
|
|
144
|
+
request = self.prepare_request(
|
|
145
|
+
method='POST',
|
|
146
|
+
url=url,
|
|
147
|
+
headers=headers,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
response = self.send(request, **kwargs)
|
|
151
|
+
return response
|
|
152
|
+
|
|
153
|
+
def delete_instance_admintokens(
|
|
154
|
+
self,
|
|
155
|
+
instance_id: str,
|
|
156
|
+
**kwargs,
|
|
157
|
+
) -> DetailedResponse:
|
|
158
|
+
"""
|
|
159
|
+
Revoke admin tokens.
|
|
160
|
+
|
|
161
|
+
Revoke all active Vault admin tokens. This immediately invalidates all existing
|
|
162
|
+
admin tokens.
|
|
163
|
+
|
|
164
|
+
:param str instance_id: The service instance ID.
|
|
165
|
+
:param dict headers: A `dict` containing the request headers
|
|
166
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
167
|
+
:rtype: DetailedResponse
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
if not instance_id:
|
|
171
|
+
raise ValueError('instance_id must be provided')
|
|
172
|
+
headers = {}
|
|
173
|
+
sdk_headers = get_sdk_headers(
|
|
174
|
+
service_name=self.DEFAULT_SERVICE_NAME,
|
|
175
|
+
service_version='V2',
|
|
176
|
+
operation_id='delete_instance_admintokens',
|
|
177
|
+
)
|
|
178
|
+
headers.update(sdk_headers)
|
|
179
|
+
|
|
180
|
+
if 'headers' in kwargs:
|
|
181
|
+
headers.update(kwargs.get('headers'))
|
|
182
|
+
del kwargs['headers']
|
|
183
|
+
|
|
184
|
+
path_param_keys = ['instance_id']
|
|
185
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
186
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
187
|
+
url = '/api/v2/instances/{instance_id}/admintokens'.format(**path_param_dict)
|
|
188
|
+
request = self.prepare_request(
|
|
189
|
+
method='DELETE',
|
|
190
|
+
url=url,
|
|
191
|
+
headers=headers,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
response = self.send(request, **kwargs)
|
|
195
|
+
return response
|
|
196
|
+
|
|
197
|
+
#########################
|
|
198
|
+
# Instances
|
|
199
|
+
#########################
|
|
200
|
+
|
|
201
|
+
def get_instance(
|
|
202
|
+
self,
|
|
203
|
+
instance_id: str,
|
|
204
|
+
**kwargs,
|
|
205
|
+
) -> DetailedResponse:
|
|
206
|
+
"""
|
|
207
|
+
Get instance details.
|
|
208
|
+
|
|
209
|
+
Get service instance details including cluster state, endpoints, and key
|
|
210
|
+
management service.
|
|
211
|
+
|
|
212
|
+
:param str instance_id: The service instance ID.
|
|
213
|
+
:param dict headers: A `dict` containing the request headers
|
|
214
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
215
|
+
:rtype: DetailedResponse with `dict` result representing a `Instance` object
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
if not instance_id:
|
|
219
|
+
raise ValueError('instance_id must be provided')
|
|
220
|
+
headers = {}
|
|
221
|
+
sdk_headers = get_sdk_headers(
|
|
222
|
+
service_name=self.DEFAULT_SERVICE_NAME,
|
|
223
|
+
service_version='V2',
|
|
224
|
+
operation_id='get_instance',
|
|
225
|
+
)
|
|
226
|
+
headers.update(sdk_headers)
|
|
227
|
+
|
|
228
|
+
if 'headers' in kwargs:
|
|
229
|
+
headers.update(kwargs.get('headers'))
|
|
230
|
+
del kwargs['headers']
|
|
231
|
+
headers['Accept'] = 'application/json'
|
|
232
|
+
|
|
233
|
+
path_param_keys = ['instance_id']
|
|
234
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
235
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
236
|
+
url = '/api/v2/instances/{instance_id}'.format(**path_param_dict)
|
|
237
|
+
request = self.prepare_request(
|
|
238
|
+
method='GET',
|
|
239
|
+
url=url,
|
|
240
|
+
headers=headers,
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
response = self.send(request, **kwargs)
|
|
244
|
+
return response
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
##############################################################################
|
|
248
|
+
# Models
|
|
249
|
+
##############################################################################
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
class Instance:
|
|
253
|
+
"""
|
|
254
|
+
The service instance information.
|
|
255
|
+
|
|
256
|
+
:param str instance_crn: The instance CRN identifier.
|
|
257
|
+
:param str plan: Instance plan name.
|
|
258
|
+
:param VaultDedicatedCluster vault_cluster: Vault cluster information for Vault
|
|
259
|
+
Dedicated instances.
|
|
260
|
+
:param VaultDedicatedInstanceEndpoints endpoints: Instance endpoints for Vault
|
|
261
|
+
Dedicated instances.
|
|
262
|
+
:param VaultDedicatedInstanceEncryption encryption: Vault encryption
|
|
263
|
+
configuration for Vault Dedicated instances.
|
|
264
|
+
"""
|
|
265
|
+
|
|
266
|
+
def __init__(
|
|
267
|
+
self,
|
|
268
|
+
instance_crn: str,
|
|
269
|
+
plan: str,
|
|
270
|
+
vault_cluster: 'VaultDedicatedCluster',
|
|
271
|
+
endpoints: 'VaultDedicatedInstanceEndpoints',
|
|
272
|
+
encryption: 'VaultDedicatedInstanceEncryption',
|
|
273
|
+
) -> None:
|
|
274
|
+
"""
|
|
275
|
+
Initialize a Instance object.
|
|
276
|
+
|
|
277
|
+
:param str instance_crn: The instance CRN identifier.
|
|
278
|
+
:param str plan: Instance plan name.
|
|
279
|
+
:param VaultDedicatedCluster vault_cluster: Vault cluster information for
|
|
280
|
+
Vault Dedicated instances.
|
|
281
|
+
:param VaultDedicatedInstanceEndpoints endpoints: Instance endpoints for
|
|
282
|
+
Vault Dedicated instances.
|
|
283
|
+
:param VaultDedicatedInstanceEncryption encryption: Vault encryption
|
|
284
|
+
configuration for Vault Dedicated instances.
|
|
285
|
+
"""
|
|
286
|
+
self.instance_crn = instance_crn
|
|
287
|
+
self.plan = plan
|
|
288
|
+
self.vault_cluster = vault_cluster
|
|
289
|
+
self.endpoints = endpoints
|
|
290
|
+
self.encryption = encryption
|
|
291
|
+
|
|
292
|
+
@classmethod
|
|
293
|
+
def from_dict(cls, _dict: Dict) -> 'Instance':
|
|
294
|
+
"""Initialize a Instance object from a json dictionary."""
|
|
295
|
+
args = {}
|
|
296
|
+
if (instance_crn := _dict.get('instance_crn')) is not None:
|
|
297
|
+
args['instance_crn'] = instance_crn
|
|
298
|
+
else:
|
|
299
|
+
raise ValueError('Required property \'instance_crn\' not present in Instance JSON')
|
|
300
|
+
if (plan := _dict.get('plan')) is not None:
|
|
301
|
+
args['plan'] = plan
|
|
302
|
+
else:
|
|
303
|
+
raise ValueError('Required property \'plan\' not present in Instance JSON')
|
|
304
|
+
if (vault_cluster := _dict.get('vault_cluster')) is not None:
|
|
305
|
+
args['vault_cluster'] = VaultDedicatedCluster.from_dict(vault_cluster)
|
|
306
|
+
else:
|
|
307
|
+
raise ValueError('Required property \'vault_cluster\' not present in Instance JSON')
|
|
308
|
+
if (endpoints := _dict.get('endpoints')) is not None:
|
|
309
|
+
args['endpoints'] = VaultDedicatedInstanceEndpoints.from_dict(endpoints)
|
|
310
|
+
else:
|
|
311
|
+
raise ValueError('Required property \'endpoints\' not present in Instance JSON')
|
|
312
|
+
if (encryption := _dict.get('encryption')) is not None:
|
|
313
|
+
args['encryption'] = VaultDedicatedInstanceEncryption.from_dict(encryption)
|
|
314
|
+
else:
|
|
315
|
+
raise ValueError('Required property \'encryption\' not present in Instance JSON')
|
|
316
|
+
return cls(**args)
|
|
317
|
+
|
|
318
|
+
@classmethod
|
|
319
|
+
def _from_dict(cls, _dict):
|
|
320
|
+
"""Initialize a Instance object from a json dictionary."""
|
|
321
|
+
return cls.from_dict(_dict)
|
|
322
|
+
|
|
323
|
+
def to_dict(self) -> Dict:
|
|
324
|
+
"""Return a json dictionary representing this model."""
|
|
325
|
+
_dict = {}
|
|
326
|
+
if hasattr(self, 'instance_crn') and self.instance_crn is not None:
|
|
327
|
+
_dict['instance_crn'] = self.instance_crn
|
|
328
|
+
if hasattr(self, 'plan') and self.plan is not None:
|
|
329
|
+
_dict['plan'] = self.plan
|
|
330
|
+
if hasattr(self, 'vault_cluster') and self.vault_cluster is not None:
|
|
331
|
+
if isinstance(self.vault_cluster, dict):
|
|
332
|
+
_dict['vault_cluster'] = self.vault_cluster
|
|
333
|
+
else:
|
|
334
|
+
_dict['vault_cluster'] = self.vault_cluster.to_dict()
|
|
335
|
+
if hasattr(self, 'endpoints') and self.endpoints is not None:
|
|
336
|
+
if isinstance(self.endpoints, dict):
|
|
337
|
+
_dict['endpoints'] = self.endpoints
|
|
338
|
+
else:
|
|
339
|
+
_dict['endpoints'] = self.endpoints.to_dict()
|
|
340
|
+
if hasattr(self, 'encryption') and self.encryption is not None:
|
|
341
|
+
if isinstance(self.encryption, dict):
|
|
342
|
+
_dict['encryption'] = self.encryption
|
|
343
|
+
else:
|
|
344
|
+
_dict['encryption'] = self.encryption.to_dict()
|
|
345
|
+
return _dict
|
|
346
|
+
|
|
347
|
+
def _to_dict(self):
|
|
348
|
+
"""Return a json dictionary representing this model."""
|
|
349
|
+
return self.to_dict()
|
|
350
|
+
|
|
351
|
+
def __str__(self) -> str:
|
|
352
|
+
"""Return a `str` version of this Instance object."""
|
|
353
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
354
|
+
|
|
355
|
+
def __eq__(self, other: 'Instance') -> bool:
|
|
356
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
357
|
+
if not isinstance(other, self.__class__):
|
|
358
|
+
return False
|
|
359
|
+
return self.__dict__ == other.__dict__
|
|
360
|
+
|
|
361
|
+
def __ne__(self, other: 'Instance') -> bool:
|
|
362
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
363
|
+
return not self == other
|
|
364
|
+
|
|
365
|
+
class PlanEnum(str, Enum):
|
|
366
|
+
"""
|
|
367
|
+
Instance plan name.
|
|
368
|
+
"""
|
|
369
|
+
|
|
370
|
+
DEDICATED = 'dedicated'
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
class Token:
|
|
375
|
+
"""
|
|
376
|
+
Admin Token response.
|
|
377
|
+
|
|
378
|
+
:param str token: The token value.
|
|
379
|
+
"""
|
|
380
|
+
|
|
381
|
+
def __init__(
|
|
382
|
+
self,
|
|
383
|
+
token: str,
|
|
384
|
+
) -> None:
|
|
385
|
+
"""
|
|
386
|
+
Initialize a Token object.
|
|
387
|
+
|
|
388
|
+
:param str token: The token value.
|
|
389
|
+
"""
|
|
390
|
+
self.token = token
|
|
391
|
+
|
|
392
|
+
@classmethod
|
|
393
|
+
def from_dict(cls, _dict: Dict) -> 'Token':
|
|
394
|
+
"""Initialize a Token object from a json dictionary."""
|
|
395
|
+
args = {}
|
|
396
|
+
if (token := _dict.get('token')) is not None:
|
|
397
|
+
args['token'] = token
|
|
398
|
+
else:
|
|
399
|
+
raise ValueError('Required property \'token\' not present in Token JSON')
|
|
400
|
+
return cls(**args)
|
|
401
|
+
|
|
402
|
+
@classmethod
|
|
403
|
+
def _from_dict(cls, _dict):
|
|
404
|
+
"""Initialize a Token object from a json dictionary."""
|
|
405
|
+
return cls.from_dict(_dict)
|
|
406
|
+
|
|
407
|
+
def to_dict(self) -> Dict:
|
|
408
|
+
"""Return a json dictionary representing this model."""
|
|
409
|
+
_dict = {}
|
|
410
|
+
if hasattr(self, 'token') and self.token is not None:
|
|
411
|
+
_dict['token'] = self.token
|
|
412
|
+
return _dict
|
|
413
|
+
|
|
414
|
+
def _to_dict(self):
|
|
415
|
+
"""Return a json dictionary representing this model."""
|
|
416
|
+
return self.to_dict()
|
|
417
|
+
|
|
418
|
+
def __str__(self) -> str:
|
|
419
|
+
"""Return a `str` version of this Token object."""
|
|
420
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
421
|
+
|
|
422
|
+
def __eq__(self, other: 'Token') -> bool:
|
|
423
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
424
|
+
if not isinstance(other, self.__class__):
|
|
425
|
+
return False
|
|
426
|
+
return self.__dict__ == other.__dict__
|
|
427
|
+
|
|
428
|
+
def __ne__(self, other: 'Token') -> bool:
|
|
429
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
430
|
+
return not self == other
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
class VaultDedicatedCluster:
|
|
434
|
+
"""
|
|
435
|
+
Vault cluster information for Vault Dedicated instances.
|
|
436
|
+
|
|
437
|
+
:param str status: Vault cluster status. Possible values:
|
|
438
|
+
- sealed: The Vault cluster is sealed and requires unsealing to access secrets
|
|
439
|
+
- not_initialized: The Vault cluster has not been initialized yet
|
|
440
|
+
- healthy: The Vault cluster is operational and ready to serve requests.
|
|
441
|
+
:param str version: Vault cluster version.
|
|
442
|
+
"""
|
|
443
|
+
|
|
444
|
+
def __init__(
|
|
445
|
+
self,
|
|
446
|
+
status: str,
|
|
447
|
+
version: str,
|
|
448
|
+
) -> None:
|
|
449
|
+
"""
|
|
450
|
+
Initialize a VaultDedicatedCluster object.
|
|
451
|
+
|
|
452
|
+
:param str status: Vault cluster status. Possible values:
|
|
453
|
+
- sealed: The Vault cluster is sealed and requires unsealing to access
|
|
454
|
+
secrets
|
|
455
|
+
- not_initialized: The Vault cluster has not been initialized yet
|
|
456
|
+
- healthy: The Vault cluster is operational and ready to serve requests.
|
|
457
|
+
:param str version: Vault cluster version.
|
|
458
|
+
"""
|
|
459
|
+
self.status = status
|
|
460
|
+
self.version = version
|
|
461
|
+
|
|
462
|
+
@classmethod
|
|
463
|
+
def from_dict(cls, _dict: Dict) -> 'VaultDedicatedCluster':
|
|
464
|
+
"""Initialize a VaultDedicatedCluster object from a json dictionary."""
|
|
465
|
+
args = {}
|
|
466
|
+
if (status := _dict.get('status')) is not None:
|
|
467
|
+
args['status'] = status
|
|
468
|
+
else:
|
|
469
|
+
raise ValueError('Required property \'status\' not present in VaultDedicatedCluster JSON')
|
|
470
|
+
if (version := _dict.get('version')) is not None:
|
|
471
|
+
args['version'] = version
|
|
472
|
+
else:
|
|
473
|
+
raise ValueError('Required property \'version\' not present in VaultDedicatedCluster JSON')
|
|
474
|
+
return cls(**args)
|
|
475
|
+
|
|
476
|
+
@classmethod
|
|
477
|
+
def _from_dict(cls, _dict):
|
|
478
|
+
"""Initialize a VaultDedicatedCluster object from a json dictionary."""
|
|
479
|
+
return cls.from_dict(_dict)
|
|
480
|
+
|
|
481
|
+
def to_dict(self) -> Dict:
|
|
482
|
+
"""Return a json dictionary representing this model."""
|
|
483
|
+
_dict = {}
|
|
484
|
+
if hasattr(self, 'status') and self.status is not None:
|
|
485
|
+
_dict['status'] = self.status
|
|
486
|
+
if hasattr(self, 'version') and self.version is not None:
|
|
487
|
+
_dict['version'] = self.version
|
|
488
|
+
return _dict
|
|
489
|
+
|
|
490
|
+
def _to_dict(self):
|
|
491
|
+
"""Return a json dictionary representing this model."""
|
|
492
|
+
return self.to_dict()
|
|
493
|
+
|
|
494
|
+
def __str__(self) -> str:
|
|
495
|
+
"""Return a `str` version of this VaultDedicatedCluster object."""
|
|
496
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
497
|
+
|
|
498
|
+
def __eq__(self, other: 'VaultDedicatedCluster') -> bool:
|
|
499
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
500
|
+
if not isinstance(other, self.__class__):
|
|
501
|
+
return False
|
|
502
|
+
return self.__dict__ == other.__dict__
|
|
503
|
+
|
|
504
|
+
def __ne__(self, other: 'VaultDedicatedCluster') -> bool:
|
|
505
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
506
|
+
return not self == other
|
|
507
|
+
|
|
508
|
+
class StatusEnum(str, Enum):
|
|
509
|
+
"""
|
|
510
|
+
Vault cluster status. Possible values:
|
|
511
|
+
- sealed: The Vault cluster is sealed and requires unsealing to access secrets
|
|
512
|
+
- not_initialized: The Vault cluster has not been initialized yet
|
|
513
|
+
- healthy: The Vault cluster is operational and ready to serve requests.
|
|
514
|
+
"""
|
|
515
|
+
|
|
516
|
+
SEALED = 'sealed'
|
|
517
|
+
NOT_INITIALIZED = 'not_initialized'
|
|
518
|
+
HEALTHY = 'healthy'
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
class VaultDedicatedEndpointsData:
|
|
523
|
+
"""
|
|
524
|
+
Endpoint URLs for accessing the Vault Dedicated instance.
|
|
525
|
+
|
|
526
|
+
:param str vault_api: Vault API endpoint URL.
|
|
527
|
+
:param str vault_ui: Vault UI endpoint URL.
|
|
528
|
+
"""
|
|
529
|
+
|
|
530
|
+
def __init__(
|
|
531
|
+
self,
|
|
532
|
+
vault_api: str,
|
|
533
|
+
vault_ui: str,
|
|
534
|
+
) -> None:
|
|
535
|
+
"""
|
|
536
|
+
Initialize a VaultDedicatedEndpointsData object.
|
|
537
|
+
|
|
538
|
+
:param str vault_api: Vault API endpoint URL.
|
|
539
|
+
:param str vault_ui: Vault UI endpoint URL.
|
|
540
|
+
"""
|
|
541
|
+
self.vault_api = vault_api
|
|
542
|
+
self.vault_ui = vault_ui
|
|
543
|
+
|
|
544
|
+
@classmethod
|
|
545
|
+
def from_dict(cls, _dict: Dict) -> 'VaultDedicatedEndpointsData':
|
|
546
|
+
"""Initialize a VaultDedicatedEndpointsData object from a json dictionary."""
|
|
547
|
+
args = {}
|
|
548
|
+
if (vault_api := _dict.get('vault_api')) is not None:
|
|
549
|
+
args['vault_api'] = vault_api
|
|
550
|
+
else:
|
|
551
|
+
raise ValueError('Required property \'vault_api\' not present in VaultDedicatedEndpointsData JSON')
|
|
552
|
+
if (vault_ui := _dict.get('vault_ui')) is not None:
|
|
553
|
+
args['vault_ui'] = vault_ui
|
|
554
|
+
else:
|
|
555
|
+
raise ValueError('Required property \'vault_ui\' not present in VaultDedicatedEndpointsData JSON')
|
|
556
|
+
return cls(**args)
|
|
557
|
+
|
|
558
|
+
@classmethod
|
|
559
|
+
def _from_dict(cls, _dict):
|
|
560
|
+
"""Initialize a VaultDedicatedEndpointsData object from a json dictionary."""
|
|
561
|
+
return cls.from_dict(_dict)
|
|
562
|
+
|
|
563
|
+
def to_dict(self) -> Dict:
|
|
564
|
+
"""Return a json dictionary representing this model."""
|
|
565
|
+
_dict = {}
|
|
566
|
+
if hasattr(self, 'vault_api') and self.vault_api is not None:
|
|
567
|
+
_dict['vault_api'] = self.vault_api
|
|
568
|
+
if hasattr(self, 'vault_ui') and self.vault_ui is not None:
|
|
569
|
+
_dict['vault_ui'] = self.vault_ui
|
|
570
|
+
return _dict
|
|
571
|
+
|
|
572
|
+
def _to_dict(self):
|
|
573
|
+
"""Return a json dictionary representing this model."""
|
|
574
|
+
return self.to_dict()
|
|
575
|
+
|
|
576
|
+
def __str__(self) -> str:
|
|
577
|
+
"""Return a `str` version of this VaultDedicatedEndpointsData object."""
|
|
578
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
579
|
+
|
|
580
|
+
def __eq__(self, other: 'VaultDedicatedEndpointsData') -> bool:
|
|
581
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
582
|
+
if not isinstance(other, self.__class__):
|
|
583
|
+
return False
|
|
584
|
+
return self.__dict__ == other.__dict__
|
|
585
|
+
|
|
586
|
+
def __ne__(self, other: 'VaultDedicatedEndpointsData') -> bool:
|
|
587
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
588
|
+
return not self == other
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
class VaultDedicatedInstanceEncryption:
|
|
592
|
+
"""
|
|
593
|
+
Vault encryption configuration for Vault Dedicated instances.
|
|
594
|
+
|
|
595
|
+
:param str mode: Vault encryption mode.
|
|
596
|
+
:param str provider: (optional) Vault encryption provider (only present for
|
|
597
|
+
customer_managed mode). Valid value - 'key_protect'.
|
|
598
|
+
:param str key_crn: (optional) Vault encryption key CRN (only present for
|
|
599
|
+
customer_managed mode).
|
|
600
|
+
"""
|
|
601
|
+
|
|
602
|
+
def __init__(
|
|
603
|
+
self,
|
|
604
|
+
mode: str,
|
|
605
|
+
*,
|
|
606
|
+
provider: Optional[str] = None,
|
|
607
|
+
key_crn: Optional[str] = None,
|
|
608
|
+
) -> None:
|
|
609
|
+
"""
|
|
610
|
+
Initialize a VaultDedicatedInstanceEncryption object.
|
|
611
|
+
|
|
612
|
+
:param str mode: Vault encryption mode.
|
|
613
|
+
:param str provider: (optional) Vault encryption provider (only present for
|
|
614
|
+
customer_managed mode). Valid value - 'key_protect'.
|
|
615
|
+
:param str key_crn: (optional) Vault encryption key CRN (only present for
|
|
616
|
+
customer_managed mode).
|
|
617
|
+
"""
|
|
618
|
+
self.mode = mode
|
|
619
|
+
self.provider = provider
|
|
620
|
+
self.key_crn = key_crn
|
|
621
|
+
|
|
622
|
+
@classmethod
|
|
623
|
+
def from_dict(cls, _dict: Dict) -> 'VaultDedicatedInstanceEncryption':
|
|
624
|
+
"""Initialize a VaultDedicatedInstanceEncryption object from a json dictionary."""
|
|
625
|
+
args = {}
|
|
626
|
+
if (mode := _dict.get('mode')) is not None:
|
|
627
|
+
args['mode'] = mode
|
|
628
|
+
else:
|
|
629
|
+
raise ValueError('Required property \'mode\' not present in VaultDedicatedInstanceEncryption JSON')
|
|
630
|
+
if (provider := _dict.get('provider')) is not None:
|
|
631
|
+
args['provider'] = provider
|
|
632
|
+
if (key_crn := _dict.get('key_crn')) is not None:
|
|
633
|
+
args['key_crn'] = key_crn
|
|
634
|
+
return cls(**args)
|
|
635
|
+
|
|
636
|
+
@classmethod
|
|
637
|
+
def _from_dict(cls, _dict):
|
|
638
|
+
"""Initialize a VaultDedicatedInstanceEncryption object from a json dictionary."""
|
|
639
|
+
return cls.from_dict(_dict)
|
|
640
|
+
|
|
641
|
+
def to_dict(self) -> Dict:
|
|
642
|
+
"""Return a json dictionary representing this model."""
|
|
643
|
+
_dict = {}
|
|
644
|
+
if hasattr(self, 'mode') and self.mode is not None:
|
|
645
|
+
_dict['mode'] = self.mode
|
|
646
|
+
if hasattr(self, 'provider') and self.provider is not None:
|
|
647
|
+
_dict['provider'] = self.provider
|
|
648
|
+
if hasattr(self, 'key_crn') and self.key_crn is not None:
|
|
649
|
+
_dict['key_crn'] = self.key_crn
|
|
650
|
+
return _dict
|
|
651
|
+
|
|
652
|
+
def _to_dict(self):
|
|
653
|
+
"""Return a json dictionary representing this model."""
|
|
654
|
+
return self.to_dict()
|
|
655
|
+
|
|
656
|
+
def __str__(self) -> str:
|
|
657
|
+
"""Return a `str` version of this VaultDedicatedInstanceEncryption object."""
|
|
658
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
659
|
+
|
|
660
|
+
def __eq__(self, other: 'VaultDedicatedInstanceEncryption') -> bool:
|
|
661
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
662
|
+
if not isinstance(other, self.__class__):
|
|
663
|
+
return False
|
|
664
|
+
return self.__dict__ == other.__dict__
|
|
665
|
+
|
|
666
|
+
def __ne__(self, other: 'VaultDedicatedInstanceEncryption') -> bool:
|
|
667
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
668
|
+
return not self == other
|
|
669
|
+
|
|
670
|
+
class ModeEnum(str, Enum):
|
|
671
|
+
"""
|
|
672
|
+
Vault encryption mode.
|
|
673
|
+
"""
|
|
674
|
+
|
|
675
|
+
CUSTOMER_MANAGED = 'customer_managed'
|
|
676
|
+
SERVICE_MANAGED = 'service_managed'
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
class VaultDedicatedInstanceEndpoints:
|
|
681
|
+
"""
|
|
682
|
+
Instance endpoints for Vault Dedicated instances.
|
|
683
|
+
|
|
684
|
+
:param VaultDedicatedEndpointsData public: (optional) Endpoint URLs for
|
|
685
|
+
accessing the Vault Dedicated instance.
|
|
686
|
+
:param VaultDedicatedEndpointsData private: Endpoint URLs for accessing the
|
|
687
|
+
Vault Dedicated instance.
|
|
688
|
+
"""
|
|
689
|
+
|
|
690
|
+
def __init__(
|
|
691
|
+
self,
|
|
692
|
+
private: 'VaultDedicatedEndpointsData',
|
|
693
|
+
*,
|
|
694
|
+
public: Optional['VaultDedicatedEndpointsData'] = None,
|
|
695
|
+
) -> None:
|
|
696
|
+
"""
|
|
697
|
+
Initialize a VaultDedicatedInstanceEndpoints object.
|
|
698
|
+
|
|
699
|
+
:param VaultDedicatedEndpointsData private: Endpoint URLs for accessing the
|
|
700
|
+
Vault Dedicated instance.
|
|
701
|
+
:param VaultDedicatedEndpointsData public: (optional) Endpoint URLs for
|
|
702
|
+
accessing the Vault Dedicated instance.
|
|
703
|
+
"""
|
|
704
|
+
self.public = public
|
|
705
|
+
self.private = private
|
|
706
|
+
|
|
707
|
+
@classmethod
|
|
708
|
+
def from_dict(cls, _dict: Dict) -> 'VaultDedicatedInstanceEndpoints':
|
|
709
|
+
"""Initialize a VaultDedicatedInstanceEndpoints object from a json dictionary."""
|
|
710
|
+
args = {}
|
|
711
|
+
if (public := _dict.get('public')) is not None:
|
|
712
|
+
args['public'] = VaultDedicatedEndpointsData.from_dict(public)
|
|
713
|
+
if (private := _dict.get('private')) is not None:
|
|
714
|
+
args['private'] = VaultDedicatedEndpointsData.from_dict(private)
|
|
715
|
+
else:
|
|
716
|
+
raise ValueError('Required property \'private\' not present in VaultDedicatedInstanceEndpoints JSON')
|
|
717
|
+
return cls(**args)
|
|
718
|
+
|
|
719
|
+
@classmethod
|
|
720
|
+
def _from_dict(cls, _dict):
|
|
721
|
+
"""Initialize a VaultDedicatedInstanceEndpoints object from a json dictionary."""
|
|
722
|
+
return cls.from_dict(_dict)
|
|
723
|
+
|
|
724
|
+
def to_dict(self) -> Dict:
|
|
725
|
+
"""Return a json dictionary representing this model."""
|
|
726
|
+
_dict = {}
|
|
727
|
+
if hasattr(self, 'public') and self.public is not None:
|
|
728
|
+
if isinstance(self.public, dict):
|
|
729
|
+
_dict['public'] = self.public
|
|
730
|
+
else:
|
|
731
|
+
_dict['public'] = self.public.to_dict()
|
|
732
|
+
if hasattr(self, 'private') and self.private is not None:
|
|
733
|
+
if isinstance(self.private, dict):
|
|
734
|
+
_dict['private'] = self.private
|
|
735
|
+
else:
|
|
736
|
+
_dict['private'] = self.private.to_dict()
|
|
737
|
+
return _dict
|
|
738
|
+
|
|
739
|
+
def _to_dict(self):
|
|
740
|
+
"""Return a json dictionary representing this model."""
|
|
741
|
+
return self.to_dict()
|
|
742
|
+
|
|
743
|
+
def __str__(self) -> str:
|
|
744
|
+
"""Return a `str` version of this VaultDedicatedInstanceEndpoints object."""
|
|
745
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
746
|
+
|
|
747
|
+
def __eq__(self, other: 'VaultDedicatedInstanceEndpoints') -> bool:
|
|
748
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
749
|
+
if not isinstance(other, self.__class__):
|
|
750
|
+
return False
|
|
751
|
+
return self.__dict__ == other.__dict__
|
|
752
|
+
|
|
753
|
+
def __ne__(self, other: 'VaultDedicatedInstanceEndpoints') -> bool:
|
|
754
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
755
|
+
return not self == other
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.0.1'
|