ibm-platform-services 0.55.3__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_platform_services/__init__.py +43 -0
- ibm_platform_services/case_management_v1.py +2414 -0
- ibm_platform_services/catalog_management_v1.py +10127 -0
- ibm_platform_services/common.py +56 -0
- ibm_platform_services/context_based_restrictions_v1.py +3633 -0
- ibm_platform_services/enterprise_billing_units_v1.py +1324 -0
- ibm_platform_services/enterprise_management_v1.py +2497 -0
- ibm_platform_services/enterprise_usage_reports_v1.py +978 -0
- ibm_platform_services/global_catalog_v1.py +5129 -0
- ibm_platform_services/global_search_v2.py +497 -0
- ibm_platform_services/global_tagging_v1.py +1601 -0
- ibm_platform_services/iam_access_groups_v2.py +7684 -0
- ibm_platform_services/iam_identity_v1.py +11525 -0
- ibm_platform_services/iam_policy_management_v1.py +9016 -0
- ibm_platform_services/ibm_cloud_shell_v1.py +480 -0
- ibm_platform_services/open_service_broker_v1.py +1774 -0
- ibm_platform_services/partner_billing_units_v1.py +1381 -0
- ibm_platform_services/partner_usage_reports_v1.py +1091 -0
- ibm_platform_services/resource_controller_v2.py +4868 -0
- ibm_platform_services/resource_manager_v2.py +986 -0
- ibm_platform_services/usage_metering_v4.py +470 -0
- ibm_platform_services/usage_reports_v4.py +5165 -0
- ibm_platform_services/user_management_v1.py +1639 -0
- ibm_platform_services/version.py +5 -0
- ibm_platform_services-0.55.3.dist-info/LICENSE +201 -0
- ibm_platform_services-0.55.3.dist-info/METADATA +165 -0
- ibm_platform_services-0.55.3.dist-info/RECORD +29 -0
- ibm_platform_services-0.55.3.dist-info/WHEEL +5 -0
- ibm_platform_services-0.55.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1774 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# (C) Copyright IBM Corp. 2020.
|
|
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: 99-SNAPSHOT-d753183b-20201209-163011
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
Contribute resources to the IBM Cloud catalog by implementing a `service broker` that
|
|
21
|
+
conforms to the [Open Service Broker
|
|
22
|
+
API](https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md) version
|
|
23
|
+
2.12 specification and provides enablement extensions for integration with IBM Cloud and
|
|
24
|
+
the Resource Controller provisioning model.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from typing import Dict, List
|
|
28
|
+
import json
|
|
29
|
+
|
|
30
|
+
from ibm_cloud_sdk_core import BaseService, DetailedResponse
|
|
31
|
+
from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator
|
|
32
|
+
from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment
|
|
33
|
+
from ibm_cloud_sdk_core.utils import convert_model
|
|
34
|
+
|
|
35
|
+
from .common import get_sdk_headers
|
|
36
|
+
|
|
37
|
+
##############################################################################
|
|
38
|
+
# Service
|
|
39
|
+
##############################################################################
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class OpenServiceBrokerV1(BaseService):
|
|
43
|
+
"""The Open Service Broker V1 service."""
|
|
44
|
+
|
|
45
|
+
DEFAULT_SERVICE_URL = None
|
|
46
|
+
DEFAULT_SERVICE_NAME = 'open_service_broker'
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def new_instance(
|
|
50
|
+
cls,
|
|
51
|
+
service_name: str = DEFAULT_SERVICE_NAME,
|
|
52
|
+
) -> 'OpenServiceBrokerV1':
|
|
53
|
+
"""
|
|
54
|
+
Return a new client for the Open Service Broker service using the specified
|
|
55
|
+
parameters and external configuration.
|
|
56
|
+
"""
|
|
57
|
+
authenticator = get_authenticator_from_environment(service_name)
|
|
58
|
+
service = cls(authenticator)
|
|
59
|
+
service.configure_service(service_name)
|
|
60
|
+
return service
|
|
61
|
+
|
|
62
|
+
def __init__(
|
|
63
|
+
self,
|
|
64
|
+
authenticator: Authenticator = None,
|
|
65
|
+
) -> None:
|
|
66
|
+
"""
|
|
67
|
+
Construct a new client for the Open Service Broker service.
|
|
68
|
+
|
|
69
|
+
:param Authenticator authenticator: The authenticator specifies the authentication mechanism.
|
|
70
|
+
Get up to date information from https://github.com/IBM/python-sdk-core/blob/master/README.md
|
|
71
|
+
about initializing the authenticator of your choice.
|
|
72
|
+
"""
|
|
73
|
+
BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator)
|
|
74
|
+
|
|
75
|
+
#########################
|
|
76
|
+
# Enable and Disable Instances
|
|
77
|
+
#########################
|
|
78
|
+
|
|
79
|
+
def get_service_instance_state(self, instance_id: str, **kwargs) -> DetailedResponse:
|
|
80
|
+
"""
|
|
81
|
+
Get the current state of the service instance.
|
|
82
|
+
|
|
83
|
+
Get the current state information associated with the service instance.
|
|
84
|
+
As a service provider you need a way to manage provisioned service instances. If
|
|
85
|
+
an account comes past due, you may need a to disable the service (without deleting
|
|
86
|
+
it), and when the account is settled re-enable the service.
|
|
87
|
+
This endpoint allows both the provider and IBM Cloud to query for the state of a
|
|
88
|
+
provisioned service instance. For example, IBM Cloud may query the provider to
|
|
89
|
+
figure out if a given service is disabled or not and present that state to the
|
|
90
|
+
user.
|
|
91
|
+
|
|
92
|
+
:param str instance_id: The `instance_id` of a service instance is provided
|
|
93
|
+
by the IBM Cloud platform. This ID will be used for future requests to bind
|
|
94
|
+
and deprovision, so the broker can use it to correlate the resource it
|
|
95
|
+
creates.
|
|
96
|
+
:param dict headers: A `dict` containing the request headers
|
|
97
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
98
|
+
:rtype: DetailedResponse with `dict` result representing a `Resp1874644Root` object
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
if instance_id is None:
|
|
102
|
+
raise ValueError('instance_id must be provided')
|
|
103
|
+
headers = {}
|
|
104
|
+
sdk_headers = get_sdk_headers(
|
|
105
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_service_instance_state'
|
|
106
|
+
)
|
|
107
|
+
headers.update(sdk_headers)
|
|
108
|
+
|
|
109
|
+
if 'headers' in kwargs:
|
|
110
|
+
headers.update(kwargs.get('headers'))
|
|
111
|
+
headers['Accept'] = 'application/json'
|
|
112
|
+
|
|
113
|
+
path_param_keys = ['instance_id']
|
|
114
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
115
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
116
|
+
url = '/bluemix_v1/service_instances/{instance_id}'.format(**path_param_dict)
|
|
117
|
+
request = self.prepare_request(method='GET', url=url, headers=headers)
|
|
118
|
+
|
|
119
|
+
response = self.send(request)
|
|
120
|
+
return response
|
|
121
|
+
|
|
122
|
+
def replace_service_instance_state(
|
|
123
|
+
self, instance_id: str, *, enabled: bool = None, initiator_id: str = None, reason_code: str = None, **kwargs
|
|
124
|
+
) -> DetailedResponse:
|
|
125
|
+
"""
|
|
126
|
+
Update the state of a provisioned service instance.
|
|
127
|
+
|
|
128
|
+
Update (disable or enable) the state of a provisioned service instance. As a
|
|
129
|
+
service provider you need a way to manage provisioned service instances. If an
|
|
130
|
+
account comes past due, you may need a to disable the service (without deleting
|
|
131
|
+
it), and when the account is settled re-enable the service. This endpoint allows
|
|
132
|
+
the provider to enable or disable the state of a provisioned service instance. It
|
|
133
|
+
is the service provider's responsibility to disable access to the service instance
|
|
134
|
+
when the disable endpoint is invoked and to re-enable that access when the enable
|
|
135
|
+
endpoint is invoked. When your service broker receives an enable / disable
|
|
136
|
+
request, it should take whatever action is necessary to enable / disable
|
|
137
|
+
(respectively) the service. Additionally, If a bind request comes in for a
|
|
138
|
+
disabled service, the broker should reject that request with any code other than
|
|
139
|
+
`204`, and provide a user-facing message in the description.
|
|
140
|
+
|
|
141
|
+
:param str instance_id: The `instance_id` of a service instance is provided
|
|
142
|
+
by the IBM Cloud platform. This ID will be used for future requests to bind
|
|
143
|
+
and deprovision, so the broker can use it to correlate the resource it
|
|
144
|
+
creates.
|
|
145
|
+
:param bool enabled: (optional) Indicates the current state of the service
|
|
146
|
+
instance.
|
|
147
|
+
:param str initiator_id: (optional) Optional string that shows the user ID
|
|
148
|
+
that is initiating the call.
|
|
149
|
+
:param str reason_code: (optional) Optional string that states the reason
|
|
150
|
+
code for the service instance state change. Valid values are
|
|
151
|
+
`IBMCLOUD_ACCT_ACTIVATE`, `IBMCLOUD_RECLAMATION_RESTORE`, or
|
|
152
|
+
`IBMCLOUD_SERVICE_INSTANCE_BELOW_CAP` for enable calls;
|
|
153
|
+
`IBMCLOUD_ACCT_SUSPEND`, `IBMCLOUD_RECLAMATION_SCHEDULE`, or
|
|
154
|
+
`IBMCLOUD_SERVICE_INSTANCE_ABOVE_CAP` for disable calls; and
|
|
155
|
+
`IBMCLOUD_ADMIN_REQUEST` for enable and disable calls.<br/><br/>Previously
|
|
156
|
+
accepted values had a `BMX_` prefix, such as `BMX_ACCT_ACTIVATE`. These
|
|
157
|
+
values are deprecated.
|
|
158
|
+
:param dict headers: A `dict` containing the request headers
|
|
159
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
160
|
+
:rtype: DetailedResponse with `dict` result representing a `Resp2448145Root` object
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
if instance_id is None:
|
|
164
|
+
raise ValueError('instance_id must be provided')
|
|
165
|
+
headers = {}
|
|
166
|
+
sdk_headers = get_sdk_headers(
|
|
167
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='replace_service_instance_state'
|
|
168
|
+
)
|
|
169
|
+
headers.update(sdk_headers)
|
|
170
|
+
|
|
171
|
+
data = {'enabled': enabled, 'initiator_id': initiator_id, 'reason_code': reason_code}
|
|
172
|
+
data = {k: v for (k, v) in data.items() if v is not None}
|
|
173
|
+
data = json.dumps(data)
|
|
174
|
+
headers['content-type'] = 'application/json'
|
|
175
|
+
|
|
176
|
+
if 'headers' in kwargs:
|
|
177
|
+
headers.update(kwargs.get('headers'))
|
|
178
|
+
headers['Accept'] = 'application/json'
|
|
179
|
+
|
|
180
|
+
path_param_keys = ['instance_id']
|
|
181
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
182
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
183
|
+
url = '/bluemix_v1/service_instances/{instance_id}'.format(**path_param_dict)
|
|
184
|
+
request = self.prepare_request(method='PUT', url=url, headers=headers, data=data)
|
|
185
|
+
|
|
186
|
+
response = self.send(request)
|
|
187
|
+
return response
|
|
188
|
+
|
|
189
|
+
#########################
|
|
190
|
+
# Resource Instances
|
|
191
|
+
#########################
|
|
192
|
+
|
|
193
|
+
def replace_service_instance(
|
|
194
|
+
self,
|
|
195
|
+
instance_id: str,
|
|
196
|
+
*,
|
|
197
|
+
organization_guid: str = None,
|
|
198
|
+
plan_id: str = None,
|
|
199
|
+
service_id: str = None,
|
|
200
|
+
space_guid: str = None,
|
|
201
|
+
context: 'Context' = None,
|
|
202
|
+
parameters: dict = None,
|
|
203
|
+
accepts_incomplete: bool = None,
|
|
204
|
+
**kwargs,
|
|
205
|
+
) -> DetailedResponse:
|
|
206
|
+
"""
|
|
207
|
+
Create (provision) a service instance.
|
|
208
|
+
|
|
209
|
+
Create a service instance with GUID. When your service broker receives a provision
|
|
210
|
+
request from the IBM Cloud platform, it MUST take whatever action is necessary to
|
|
211
|
+
create a new resource.
|
|
212
|
+
When a user creates a service instance from the IBM Cloud console or the IBM Cloud
|
|
213
|
+
CLI, the IBM Cloud platform validates that the user has permission to create the
|
|
214
|
+
service instance using IBM Cloud IAM. After this validation occurs, your service
|
|
215
|
+
broker's provision endpoint (PUT /v2/resource_instances/:instance_id) will be
|
|
216
|
+
invoked. When provisioning occurs, the IBM Cloud platform provides the following
|
|
217
|
+
values:
|
|
218
|
+
- The IBM Cloud context is included in the context variable
|
|
219
|
+
- The X-Broker-API-Originating-Identity will have the IBM IAM ID of the user that
|
|
220
|
+
initiated the request
|
|
221
|
+
- The parameters section will include the requested location (and additional
|
|
222
|
+
parameters required by your service).
|
|
223
|
+
|
|
224
|
+
:param str instance_id: The `instance_id` of a service instance is provided
|
|
225
|
+
by the IBM Cloud platform. This ID will be used for future requests to bind
|
|
226
|
+
and deprovision, so the broker can use it to correlate the resource it
|
|
227
|
+
creates.
|
|
228
|
+
:param str organization_guid: (optional) Deprecated in favor of `context`.
|
|
229
|
+
The IBM Cloud platform GUID for the organization under which the service
|
|
230
|
+
instance is to be provisioned. Although most brokers will not use this
|
|
231
|
+
field, it might be helpful for executing operations on a user's behalf. It
|
|
232
|
+
MUST be a non-empty string.
|
|
233
|
+
:param str plan_id: (optional) The ID of the plan for which the service
|
|
234
|
+
instance has been requested, which is stored in the catalog.json of your
|
|
235
|
+
broker. This value should be a GUID and it MUST be unique to a service.
|
|
236
|
+
:param str service_id: (optional) The ID of the service stored in the
|
|
237
|
+
catalog.json of your broker. This value should be a GUID and it MUST be a
|
|
238
|
+
non-empty string.
|
|
239
|
+
:param str space_guid: (optional) Deprecated in favor of `context`. The
|
|
240
|
+
identifier for the project space within the IBM Cloud platform
|
|
241
|
+
organization. Although most brokers will not use this field, it might be
|
|
242
|
+
helpful for executing operations on a user's behalf. It MUST be a non-empty
|
|
243
|
+
string.
|
|
244
|
+
:param Context context: (optional) Platform specific contextual information
|
|
245
|
+
under which the service instance is to be provisioned.
|
|
246
|
+
:param dict parameters: (optional) Configuration options for the service
|
|
247
|
+
instance. An opaque object, controller treats this as a blob. Brokers
|
|
248
|
+
should ensure that the client has provided valid configuration parameters
|
|
249
|
+
and values for the operation. If this field is not present in the request
|
|
250
|
+
message, then the broker MUST NOT change the parameters of the instance as
|
|
251
|
+
a result of this request.
|
|
252
|
+
:param bool accepts_incomplete: (optional) A value of true indicates that
|
|
253
|
+
both the IBM Cloud platform and the requesting client support asynchronous
|
|
254
|
+
deprovisioning. If this parameter is not included in the request, and the
|
|
255
|
+
broker can only deprovision a service instance of the requested plan
|
|
256
|
+
asynchronously, the broker MUST reject the request with a `422`
|
|
257
|
+
Unprocessable Entity.
|
|
258
|
+
:param dict headers: A `dict` containing the request headers
|
|
259
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
260
|
+
:rtype: DetailedResponse with `dict` result representing a `Resp2079872Root` object
|
|
261
|
+
"""
|
|
262
|
+
|
|
263
|
+
if instance_id is None:
|
|
264
|
+
raise ValueError('instance_id must be provided')
|
|
265
|
+
if context is not None:
|
|
266
|
+
context = convert_model(context)
|
|
267
|
+
headers = {}
|
|
268
|
+
sdk_headers = get_sdk_headers(
|
|
269
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='replace_service_instance'
|
|
270
|
+
)
|
|
271
|
+
headers.update(sdk_headers)
|
|
272
|
+
|
|
273
|
+
params = {'accepts_incomplete': accepts_incomplete}
|
|
274
|
+
|
|
275
|
+
data = {
|
|
276
|
+
'organization_guid': organization_guid,
|
|
277
|
+
'plan_id': plan_id,
|
|
278
|
+
'service_id': service_id,
|
|
279
|
+
'space_guid': space_guid,
|
|
280
|
+
'context': context,
|
|
281
|
+
'parameters': parameters,
|
|
282
|
+
}
|
|
283
|
+
data = {k: v for (k, v) in data.items() if v is not None}
|
|
284
|
+
data = json.dumps(data)
|
|
285
|
+
headers['content-type'] = 'application/json'
|
|
286
|
+
|
|
287
|
+
if 'headers' in kwargs:
|
|
288
|
+
headers.update(kwargs.get('headers'))
|
|
289
|
+
headers['Accept'] = 'application/json'
|
|
290
|
+
|
|
291
|
+
path_param_keys = ['instance_id']
|
|
292
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
293
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
294
|
+
url = '/v2/service_instances/{instance_id}'.format(**path_param_dict)
|
|
295
|
+
request = self.prepare_request(method='PUT', url=url, headers=headers, params=params, data=data)
|
|
296
|
+
|
|
297
|
+
response = self.send(request)
|
|
298
|
+
return response
|
|
299
|
+
|
|
300
|
+
def update_service_instance(
|
|
301
|
+
self,
|
|
302
|
+
instance_id: str,
|
|
303
|
+
*,
|
|
304
|
+
service_id: str = None,
|
|
305
|
+
context: 'Context' = None,
|
|
306
|
+
parameters: dict = None,
|
|
307
|
+
plan_id: str = None,
|
|
308
|
+
previous_values: dict = None,
|
|
309
|
+
accepts_incomplete: bool = None,
|
|
310
|
+
**kwargs,
|
|
311
|
+
) -> DetailedResponse:
|
|
312
|
+
"""
|
|
313
|
+
Update a service instance.
|
|
314
|
+
|
|
315
|
+
Patch an instance by GUID. Enabling this endpoint allows your user to change plans
|
|
316
|
+
and service parameters in a provisioned service instance. If your offering
|
|
317
|
+
supports multiple plans, and you want users to be able to change plans for a
|
|
318
|
+
provisioned instance, you will need to enable the ability for users to update
|
|
319
|
+
their service instance.
|
|
320
|
+
To enable support for the update of the plan, a broker MUST declare support per
|
|
321
|
+
service by specifying `"plan_updateable": true` in your brokers' catalog.json.
|
|
322
|
+
|
|
323
|
+
:param str instance_id: The ID of a previously provisioned service
|
|
324
|
+
instance.
|
|
325
|
+
:param str service_id: (optional) The ID of the service stored in the
|
|
326
|
+
catalog.json of your broker. This value should be a GUID. It MUST be a
|
|
327
|
+
non-empty string.
|
|
328
|
+
:param Context context: (optional) Platform specific contextual information
|
|
329
|
+
under which the service instance is to be provisioned.
|
|
330
|
+
:param dict parameters: (optional) Configuration options for the service
|
|
331
|
+
instance. An opaque object, controller treats this as a blob. Brokers
|
|
332
|
+
should ensure that the client has provided valid configuration parameters
|
|
333
|
+
and values for the operation. If this field is not present in the request
|
|
334
|
+
message, then the broker MUST NOT change the parameters of the instance as
|
|
335
|
+
a result of this request.
|
|
336
|
+
:param str plan_id: (optional) The ID of the plan for which the service
|
|
337
|
+
instance has been requested, which is stored in the catalog.json of your
|
|
338
|
+
broker. This value should be a GUID. MUST be unique to a service. If
|
|
339
|
+
present, MUST be a non-empty string. If this field is not present in the
|
|
340
|
+
request message, then the broker MUST NOT change the plan of the instance
|
|
341
|
+
as a result of this request.
|
|
342
|
+
:param dict previous_values: (optional) Information about the service
|
|
343
|
+
instance prior to the update.
|
|
344
|
+
:param bool accepts_incomplete: (optional) A value of true indicates that
|
|
345
|
+
both the IBM Cloud platform and the requesting client support asynchronous
|
|
346
|
+
deprovisioning. If this parameter is not included in the request, and the
|
|
347
|
+
broker can only deprovision a service instance of the requested plan
|
|
348
|
+
asynchronously, the broker MUST reject the request with a `422`
|
|
349
|
+
Unprocessable Entity.
|
|
350
|
+
:param dict headers: A `dict` containing the request headers
|
|
351
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
352
|
+
:rtype: DetailedResponse with `dict` result representing a `Resp2079874Root` object
|
|
353
|
+
"""
|
|
354
|
+
|
|
355
|
+
if instance_id is None:
|
|
356
|
+
raise ValueError('instance_id must be provided')
|
|
357
|
+
if context is not None:
|
|
358
|
+
context = convert_model(context)
|
|
359
|
+
headers = {}
|
|
360
|
+
sdk_headers = get_sdk_headers(
|
|
361
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_service_instance'
|
|
362
|
+
)
|
|
363
|
+
headers.update(sdk_headers)
|
|
364
|
+
|
|
365
|
+
params = {'accepts_incomplete': accepts_incomplete}
|
|
366
|
+
|
|
367
|
+
data = {
|
|
368
|
+
'service_id': service_id,
|
|
369
|
+
'context': context,
|
|
370
|
+
'parameters': parameters,
|
|
371
|
+
'plan_id': plan_id,
|
|
372
|
+
'previous_values': previous_values,
|
|
373
|
+
}
|
|
374
|
+
data = {k: v for (k, v) in data.items() if v is not None}
|
|
375
|
+
data = json.dumps(data)
|
|
376
|
+
headers['content-type'] = 'application/json'
|
|
377
|
+
|
|
378
|
+
if 'headers' in kwargs:
|
|
379
|
+
headers.update(kwargs.get('headers'))
|
|
380
|
+
headers['Accept'] = 'application/json'
|
|
381
|
+
|
|
382
|
+
path_param_keys = ['instance_id']
|
|
383
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
384
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
385
|
+
url = '/v2/service_instances/{instance_id}'.format(**path_param_dict)
|
|
386
|
+
request = self.prepare_request(method='PATCH', url=url, headers=headers, params=params, data=data)
|
|
387
|
+
|
|
388
|
+
response = self.send(request)
|
|
389
|
+
return response
|
|
390
|
+
|
|
391
|
+
def delete_service_instance(
|
|
392
|
+
self, service_id: str, plan_id: str, instance_id: str, *, accepts_incomplete: bool = None, **kwargs
|
|
393
|
+
) -> DetailedResponse:
|
|
394
|
+
"""
|
|
395
|
+
Delete (deprovision) a service instance.
|
|
396
|
+
|
|
397
|
+
Delete (deprovision) a service instance by GUID. When a service broker receives a
|
|
398
|
+
deprovision request from the IBM Cloud platform, it MUST delete any resources it
|
|
399
|
+
created during the provision. Usually this means that all resources are
|
|
400
|
+
immediately reclaimed for future provisions.
|
|
401
|
+
|
|
402
|
+
:param str service_id: The ID of the service stored in the catalog.json of
|
|
403
|
+
your broker. This value should be a GUID. MUST be a non-empty string.
|
|
404
|
+
:param str plan_id: The ID of the plan for which the service instance has
|
|
405
|
+
been requested, which is stored in the catalog.json of your broker. This
|
|
406
|
+
value should be a GUID. MUST be a non-empty string.
|
|
407
|
+
:param str instance_id: The ID of a previously provisioned service
|
|
408
|
+
instance.
|
|
409
|
+
:param bool accepts_incomplete: (optional) A value of true indicates that
|
|
410
|
+
both the IBM Cloud platform and the requesting client support asynchronous
|
|
411
|
+
deprovisioning. If this parameter is not included in the request, and the
|
|
412
|
+
broker can only deprovision a service instance of the requested plan
|
|
413
|
+
asynchronously, the broker MUST reject the request with a `422`
|
|
414
|
+
Unprocessable Entity.
|
|
415
|
+
:param dict headers: A `dict` containing the request headers
|
|
416
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
417
|
+
:rtype: DetailedResponse with `dict` result representing a `Resp2079874Root` object
|
|
418
|
+
"""
|
|
419
|
+
|
|
420
|
+
if service_id is None:
|
|
421
|
+
raise ValueError('service_id must be provided')
|
|
422
|
+
if plan_id is None:
|
|
423
|
+
raise ValueError('plan_id must be provided')
|
|
424
|
+
if instance_id is None:
|
|
425
|
+
raise ValueError('instance_id must be provided')
|
|
426
|
+
headers = {}
|
|
427
|
+
sdk_headers = get_sdk_headers(
|
|
428
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_service_instance'
|
|
429
|
+
)
|
|
430
|
+
headers.update(sdk_headers)
|
|
431
|
+
|
|
432
|
+
params = {'service_id': service_id, 'plan_id': plan_id, 'accepts_incomplete': accepts_incomplete}
|
|
433
|
+
|
|
434
|
+
if 'headers' in kwargs:
|
|
435
|
+
headers.update(kwargs.get('headers'))
|
|
436
|
+
headers['Accept'] = 'application/json'
|
|
437
|
+
|
|
438
|
+
path_param_keys = ['instance_id']
|
|
439
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
440
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
441
|
+
url = '/v2/service_instances/{instance_id}'.format(**path_param_dict)
|
|
442
|
+
request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params)
|
|
443
|
+
|
|
444
|
+
response = self.send(request)
|
|
445
|
+
return response
|
|
446
|
+
|
|
447
|
+
#########################
|
|
448
|
+
# Catalog
|
|
449
|
+
#########################
|
|
450
|
+
|
|
451
|
+
def list_catalog(self, **kwargs) -> DetailedResponse:
|
|
452
|
+
"""
|
|
453
|
+
Get the catalog metadata stored within the broker.
|
|
454
|
+
|
|
455
|
+
This endpoints defines the contract between the broker and the IBM Cloud platform
|
|
456
|
+
for the services and plans that the broker supports. This endpoint returns the
|
|
457
|
+
catalog metadata stored within your broker. These values define the minimal
|
|
458
|
+
provisioning contract between your service and the IBM Cloud platform. All
|
|
459
|
+
additional catalog metadata that is not required for provisioning is stored within
|
|
460
|
+
the IBM Cloud catalog, and any updates to catalog display values that are used to
|
|
461
|
+
render your dashboard like links, icons, and i18n translated metadata should be
|
|
462
|
+
updated in the Resource Management Console (RMC), and not housed in your broker.
|
|
463
|
+
None of metadata stored in your broker is displayed in the IBM Cloud console or
|
|
464
|
+
the IBM Cloud CLI; the console and CLI will return what was set withn RMC and
|
|
465
|
+
stored in the IBM Cloud catalog.
|
|
466
|
+
|
|
467
|
+
:param dict headers: A `dict` containing the request headers
|
|
468
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
469
|
+
:rtype: DetailedResponse with `dict` result representing a `Resp1874650Root` object
|
|
470
|
+
"""
|
|
471
|
+
|
|
472
|
+
headers = {}
|
|
473
|
+
sdk_headers = get_sdk_headers(
|
|
474
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_catalog'
|
|
475
|
+
)
|
|
476
|
+
headers.update(sdk_headers)
|
|
477
|
+
|
|
478
|
+
if 'headers' in kwargs:
|
|
479
|
+
headers.update(kwargs.get('headers'))
|
|
480
|
+
headers['Accept'] = 'application/json'
|
|
481
|
+
|
|
482
|
+
url = '/v2/catalog'
|
|
483
|
+
request = self.prepare_request(method='GET', url=url, headers=headers)
|
|
484
|
+
|
|
485
|
+
response = self.send(request)
|
|
486
|
+
return response
|
|
487
|
+
|
|
488
|
+
#########################
|
|
489
|
+
# Last Operation (Async)
|
|
490
|
+
#########################
|
|
491
|
+
|
|
492
|
+
def get_last_operation(
|
|
493
|
+
self, instance_id: str, *, operation: str = None, plan_id: str = None, service_id: str = None, **kwargs
|
|
494
|
+
) -> DetailedResponse:
|
|
495
|
+
"""
|
|
496
|
+
Get the current status of a provision in-progress for a service instance.
|
|
497
|
+
|
|
498
|
+
Get `last_operation` for instance by GUID (for asynchronous provision calls). When
|
|
499
|
+
a broker returns status code `202 Accepted` during a provision, update, or
|
|
500
|
+
deprovision call, the IBM Cloud platform will begin polling the `last_operation`
|
|
501
|
+
endpoint to obtain the state of the last requested operation. The broker response
|
|
502
|
+
MUST contain the field `state` and MAY contain the field `description`.
|
|
503
|
+
Valid values for `state` are `in progress`, `succeeded`, and `failed`. The
|
|
504
|
+
platform will poll the `last_operation `endpoint as long as the broker returns
|
|
505
|
+
"state": "in progress". Returning "state": "succeeded" or "state": "failed" will
|
|
506
|
+
cause the platform to cease polling. The value provided for description will be
|
|
507
|
+
passed through to the platform API client and can be used to provide additional
|
|
508
|
+
detail for users about the progress of the operation.
|
|
509
|
+
|
|
510
|
+
:param str instance_id: The unique instance ID generated during
|
|
511
|
+
provisioning by the IBM Cloud platform.
|
|
512
|
+
:param str operation: (optional) A broker-provided identifier for the
|
|
513
|
+
operation. When a value for operation is included with asynchronous
|
|
514
|
+
responses for provision and update, and deprovision requests, the IBM Cloud
|
|
515
|
+
platform will provide the same value using this query parameter as a
|
|
516
|
+
URL-encoded string. If present, MUST be a non-empty string.
|
|
517
|
+
:param str plan_id: (optional) ID of the plan from the catalog.json in your
|
|
518
|
+
broker. If present, MUST be a non-empty string.
|
|
519
|
+
:param str service_id: (optional) ID of the service from the catalog.json
|
|
520
|
+
in your service broker. If present, MUST be a non-empty string.
|
|
521
|
+
:param dict headers: A `dict` containing the request headers
|
|
522
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
523
|
+
:rtype: DetailedResponse with `dict` result representing a `Resp2079894Root` object
|
|
524
|
+
"""
|
|
525
|
+
|
|
526
|
+
if instance_id is None:
|
|
527
|
+
raise ValueError('instance_id must be provided')
|
|
528
|
+
headers = {}
|
|
529
|
+
sdk_headers = get_sdk_headers(
|
|
530
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_last_operation'
|
|
531
|
+
)
|
|
532
|
+
headers.update(sdk_headers)
|
|
533
|
+
|
|
534
|
+
params = {'operation': operation, 'plan_id': plan_id, 'service_id': service_id}
|
|
535
|
+
|
|
536
|
+
if 'headers' in kwargs:
|
|
537
|
+
headers.update(kwargs.get('headers'))
|
|
538
|
+
headers['Accept'] = 'application/json'
|
|
539
|
+
|
|
540
|
+
path_param_keys = ['instance_id']
|
|
541
|
+
path_param_values = self.encode_path_vars(instance_id)
|
|
542
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
543
|
+
url = '/v2/service_instances/{instance_id}/last_operation'.format(**path_param_dict)
|
|
544
|
+
request = self.prepare_request(method='GET', url=url, headers=headers, params=params)
|
|
545
|
+
|
|
546
|
+
response = self.send(request)
|
|
547
|
+
return response
|
|
548
|
+
|
|
549
|
+
#########################
|
|
550
|
+
# Bindings and Credentials
|
|
551
|
+
#########################
|
|
552
|
+
|
|
553
|
+
def replace_service_binding(
|
|
554
|
+
self,
|
|
555
|
+
binding_id: str,
|
|
556
|
+
instance_id: str,
|
|
557
|
+
*,
|
|
558
|
+
plan_id: str = None,
|
|
559
|
+
service_id: str = None,
|
|
560
|
+
bind_resource: 'BindResource' = None,
|
|
561
|
+
parameters: dict = None,
|
|
562
|
+
**kwargs,
|
|
563
|
+
) -> DetailedResponse:
|
|
564
|
+
"""
|
|
565
|
+
Bind a service instance to another resource.
|
|
566
|
+
|
|
567
|
+
Create binding by GUID on service instance.
|
|
568
|
+
If your service can be bound to applications in IBM Cloud, `bindable:true` must be
|
|
569
|
+
specified in the catalog.json of your service broker. If bindable, it must be able
|
|
570
|
+
to return API endpoints and credentials to your service consumers.
|
|
571
|
+
**Note:** Brokers that do not offer any bindable services do not need to implement
|
|
572
|
+
the endpoint for bind requests.
|
|
573
|
+
See the OSB 2.12 spec for more details on
|
|
574
|
+
[binding](https://github.com/openservicebrokerapi/servicebroker/blob/v2.12/spec.md#binding).
|
|
575
|
+
|
|
576
|
+
:param str binding_id: The `binding_id` is provided by the IBM Cloud
|
|
577
|
+
platform. This ID will be used for future unbind requests, so the broker
|
|
578
|
+
can use it to correlate the resource it creates.
|
|
579
|
+
:param str instance_id: The :`instance_id` is the ID of a previously
|
|
580
|
+
provisioned service instance.
|
|
581
|
+
:param str plan_id: (optional) The ID of the plan from the catalog.json in
|
|
582
|
+
your broker. If present, it MUST be a non-empty string.
|
|
583
|
+
:param str service_id: (optional) The ID of the service from the
|
|
584
|
+
catalog.json in your broker. If present, it MUST be a non-empty string.
|
|
585
|
+
:param BindResource bind_resource: (optional) A JSON object that contains
|
|
586
|
+
data for platform resources associated with the binding to be created.
|
|
587
|
+
:param dict parameters: (optional) Configuration options for the service
|
|
588
|
+
instance. An opaque object, controller treats this as a blob. Brokers
|
|
589
|
+
should ensure that the client has provided valid configuration parameters
|
|
590
|
+
and values for the operation. If this field is not present in the request
|
|
591
|
+
message, then the broker MUST NOT change the parameters of the instance as
|
|
592
|
+
a result of this request.
|
|
593
|
+
:param dict headers: A `dict` containing the request headers
|
|
594
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
595
|
+
:rtype: DetailedResponse with `dict` result representing a `Resp2079876Root` object
|
|
596
|
+
"""
|
|
597
|
+
|
|
598
|
+
if binding_id is None:
|
|
599
|
+
raise ValueError('binding_id must be provided')
|
|
600
|
+
if instance_id is None:
|
|
601
|
+
raise ValueError('instance_id must be provided')
|
|
602
|
+
if bind_resource is not None:
|
|
603
|
+
bind_resource = convert_model(bind_resource)
|
|
604
|
+
headers = {}
|
|
605
|
+
sdk_headers = get_sdk_headers(
|
|
606
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='replace_service_binding'
|
|
607
|
+
)
|
|
608
|
+
headers.update(sdk_headers)
|
|
609
|
+
|
|
610
|
+
data = {'plan_id': plan_id, 'service_id': service_id, 'bind_resource': bind_resource, 'parameters': parameters}
|
|
611
|
+
data = {k: v for (k, v) in data.items() if v is not None}
|
|
612
|
+
data = json.dumps(data)
|
|
613
|
+
headers['content-type'] = 'application/json'
|
|
614
|
+
|
|
615
|
+
if 'headers' in kwargs:
|
|
616
|
+
headers.update(kwargs.get('headers'))
|
|
617
|
+
headers['Accept'] = 'application/json'
|
|
618
|
+
|
|
619
|
+
path_param_keys = ['binding_id', 'instance_id']
|
|
620
|
+
path_param_values = self.encode_path_vars(binding_id, instance_id)
|
|
621
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
622
|
+
url = '/v2/service_instances/{instance_id}/service_bindings/{binding_id}'.format(**path_param_dict)
|
|
623
|
+
request = self.prepare_request(method='PUT', url=url, headers=headers, data=data)
|
|
624
|
+
|
|
625
|
+
response = self.send(request)
|
|
626
|
+
return response
|
|
627
|
+
|
|
628
|
+
def delete_service_binding(
|
|
629
|
+
self, binding_id: str, instance_id: str, plan_id: str, service_id: str, **kwargs
|
|
630
|
+
) -> DetailedResponse:
|
|
631
|
+
"""
|
|
632
|
+
Delete (unbind) the credentials bound to a resource.
|
|
633
|
+
|
|
634
|
+
Delete instance binding by GUID.
|
|
635
|
+
When a broker receives an unbind request from the IBM Cloud platform, it MUST
|
|
636
|
+
delete any resources associated with the binding. In the case where credentials
|
|
637
|
+
were generated, this might result in requests to the service instance failing to
|
|
638
|
+
authenticate.
|
|
639
|
+
**Note**: Brokers that do not provide any bindable services or plans do not need
|
|
640
|
+
to implement this endpoint.
|
|
641
|
+
|
|
642
|
+
:param str binding_id: The `binding_id` is the ID of a previously
|
|
643
|
+
provisioned binding for that service instance.
|
|
644
|
+
:param str instance_id: The `instance_id` is the ID of a previously
|
|
645
|
+
provisioned service instance.
|
|
646
|
+
:param str plan_id: The ID of the plan from the catalog.json in the broker.
|
|
647
|
+
It MUST be a non-empty string and should be a GUID.
|
|
648
|
+
:param str service_id: The ID of the service from the catalog.json in the
|
|
649
|
+
broker. It MUST be a non-empty string and should be a GUID.
|
|
650
|
+
:param dict headers: A `dict` containing the request headers
|
|
651
|
+
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
|
|
652
|
+
:rtype: DetailedResponse
|
|
653
|
+
"""
|
|
654
|
+
|
|
655
|
+
if binding_id is None:
|
|
656
|
+
raise ValueError('binding_id must be provided')
|
|
657
|
+
if instance_id is None:
|
|
658
|
+
raise ValueError('instance_id must be provided')
|
|
659
|
+
if plan_id is None:
|
|
660
|
+
raise ValueError('plan_id must be provided')
|
|
661
|
+
if service_id is None:
|
|
662
|
+
raise ValueError('service_id must be provided')
|
|
663
|
+
headers = {}
|
|
664
|
+
sdk_headers = get_sdk_headers(
|
|
665
|
+
service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_service_binding'
|
|
666
|
+
)
|
|
667
|
+
headers.update(sdk_headers)
|
|
668
|
+
|
|
669
|
+
params = {'plan_id': plan_id, 'service_id': service_id}
|
|
670
|
+
|
|
671
|
+
if 'headers' in kwargs:
|
|
672
|
+
headers.update(kwargs.get('headers'))
|
|
673
|
+
headers['Accept'] = 'application/json'
|
|
674
|
+
|
|
675
|
+
path_param_keys = ['binding_id', 'instance_id']
|
|
676
|
+
path_param_values = self.encode_path_vars(binding_id, instance_id)
|
|
677
|
+
path_param_dict = dict(zip(path_param_keys, path_param_values))
|
|
678
|
+
url = '/v2/service_instances/{instance_id}/service_bindings/{binding_id}'.format(**path_param_dict)
|
|
679
|
+
request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params)
|
|
680
|
+
|
|
681
|
+
response = self.send(request)
|
|
682
|
+
return response
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
##############################################################################
|
|
686
|
+
# Models
|
|
687
|
+
##############################################################################
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
class Resp1874644Root:
|
|
691
|
+
"""
|
|
692
|
+
Check the active status of an enabled service.
|
|
693
|
+
|
|
694
|
+
:attr bool active: (optional) Indicates (from the viewpoint of the provider)
|
|
695
|
+
whether the service instance is active and is meaningful if enabled is true. The
|
|
696
|
+
default value is true if not specified.
|
|
697
|
+
:attr bool enabled: (optional) Indicates the current state of the service
|
|
698
|
+
instance.
|
|
699
|
+
:attr float last_active: (optional) Indicates when the service instance was last
|
|
700
|
+
accessed/modified/etc., and is meaningful if enabled is true AND active is
|
|
701
|
+
false. Represented as milliseconds since the epoch, but does not need to be
|
|
702
|
+
accurate to the second/hour.
|
|
703
|
+
"""
|
|
704
|
+
|
|
705
|
+
def __init__(self, *, active: bool = None, enabled: bool = None, last_active: float = None) -> None:
|
|
706
|
+
"""
|
|
707
|
+
Initialize a Resp1874644Root object.
|
|
708
|
+
|
|
709
|
+
:param bool active: (optional) Indicates (from the viewpoint of the
|
|
710
|
+
provider) whether the service instance is active and is meaningful if
|
|
711
|
+
enabled is true. The default value is true if not specified.
|
|
712
|
+
:param bool enabled: (optional) Indicates the current state of the service
|
|
713
|
+
instance.
|
|
714
|
+
:param float last_active: (optional) Indicates when the service instance
|
|
715
|
+
was last accessed/modified/etc., and is meaningful if enabled is true AND
|
|
716
|
+
active is false. Represented as milliseconds since the epoch, but does not
|
|
717
|
+
need to be accurate to the second/hour.
|
|
718
|
+
"""
|
|
719
|
+
self.active = active
|
|
720
|
+
self.enabled = enabled
|
|
721
|
+
self.last_active = last_active
|
|
722
|
+
|
|
723
|
+
@classmethod
|
|
724
|
+
def from_dict(cls, _dict: Dict) -> 'Resp1874644Root':
|
|
725
|
+
"""Initialize a Resp1874644Root object from a json dictionary."""
|
|
726
|
+
args = {}
|
|
727
|
+
if 'active' in _dict:
|
|
728
|
+
args['active'] = _dict.get('active')
|
|
729
|
+
if 'enabled' in _dict:
|
|
730
|
+
args['enabled'] = _dict.get('enabled')
|
|
731
|
+
if 'last_active' in _dict:
|
|
732
|
+
args['last_active'] = _dict.get('last_active')
|
|
733
|
+
return cls(**args)
|
|
734
|
+
|
|
735
|
+
@classmethod
|
|
736
|
+
def _from_dict(cls, _dict):
|
|
737
|
+
"""Initialize a Resp1874644Root object from a json dictionary."""
|
|
738
|
+
return cls.from_dict(_dict)
|
|
739
|
+
|
|
740
|
+
def to_dict(self) -> Dict:
|
|
741
|
+
"""Return a json dictionary representing this model."""
|
|
742
|
+
_dict = {}
|
|
743
|
+
if hasattr(self, 'active') and self.active is not None:
|
|
744
|
+
_dict['active'] = self.active
|
|
745
|
+
if hasattr(self, 'enabled') and self.enabled is not None:
|
|
746
|
+
_dict['enabled'] = self.enabled
|
|
747
|
+
if hasattr(self, 'last_active') and self.last_active is not None:
|
|
748
|
+
_dict['last_active'] = self.last_active
|
|
749
|
+
return _dict
|
|
750
|
+
|
|
751
|
+
def _to_dict(self):
|
|
752
|
+
"""Return a json dictionary representing this model."""
|
|
753
|
+
return self.to_dict()
|
|
754
|
+
|
|
755
|
+
def __str__(self) -> str:
|
|
756
|
+
"""Return a `str` version of this Resp1874644Root object."""
|
|
757
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
758
|
+
|
|
759
|
+
def __eq__(self, other: 'Resp1874644Root') -> bool:
|
|
760
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
761
|
+
if not isinstance(other, self.__class__):
|
|
762
|
+
return False
|
|
763
|
+
return self.__dict__ == other.__dict__
|
|
764
|
+
|
|
765
|
+
def __ne__(self, other: 'Resp1874644Root') -> bool:
|
|
766
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
767
|
+
return not self == other
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
class Resp1874650Root:
|
|
771
|
+
"""
|
|
772
|
+
Resp1874650Root.
|
|
773
|
+
|
|
774
|
+
:attr List[Services] services: (optional) List of services.
|
|
775
|
+
"""
|
|
776
|
+
|
|
777
|
+
def __init__(self, *, services: List['Services'] = None) -> None:
|
|
778
|
+
"""
|
|
779
|
+
Initialize a Resp1874650Root object.
|
|
780
|
+
|
|
781
|
+
:param List[Services] services: (optional) List of services.
|
|
782
|
+
"""
|
|
783
|
+
self.services = services
|
|
784
|
+
|
|
785
|
+
@classmethod
|
|
786
|
+
def from_dict(cls, _dict: Dict) -> 'Resp1874650Root':
|
|
787
|
+
"""Initialize a Resp1874650Root object from a json dictionary."""
|
|
788
|
+
args = {}
|
|
789
|
+
if 'services' in _dict:
|
|
790
|
+
args['services'] = [Services.from_dict(x) for x in _dict.get('services')]
|
|
791
|
+
return cls(**args)
|
|
792
|
+
|
|
793
|
+
@classmethod
|
|
794
|
+
def _from_dict(cls, _dict):
|
|
795
|
+
"""Initialize a Resp1874650Root object from a json dictionary."""
|
|
796
|
+
return cls.from_dict(_dict)
|
|
797
|
+
|
|
798
|
+
def to_dict(self) -> Dict:
|
|
799
|
+
"""Return a json dictionary representing this model."""
|
|
800
|
+
_dict = {}
|
|
801
|
+
if hasattr(self, 'services') and self.services is not None:
|
|
802
|
+
_dict['services'] = [x.to_dict() for x in self.services]
|
|
803
|
+
return _dict
|
|
804
|
+
|
|
805
|
+
def _to_dict(self):
|
|
806
|
+
"""Return a json dictionary representing this model."""
|
|
807
|
+
return self.to_dict()
|
|
808
|
+
|
|
809
|
+
def __str__(self) -> str:
|
|
810
|
+
"""Return a `str` version of this Resp1874650Root object."""
|
|
811
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
812
|
+
|
|
813
|
+
def __eq__(self, other: 'Resp1874650Root') -> bool:
|
|
814
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
815
|
+
if not isinstance(other, self.__class__):
|
|
816
|
+
return False
|
|
817
|
+
return self.__dict__ == other.__dict__
|
|
818
|
+
|
|
819
|
+
def __ne__(self, other: 'Resp1874650Root') -> bool:
|
|
820
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
821
|
+
return not self == other
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
class Resp2079872Root:
|
|
825
|
+
"""
|
|
826
|
+
OK - MUST be returned if the service instance already exists, is fully provisioned,
|
|
827
|
+
and the requested parameters are identical to the existing service instance.
|
|
828
|
+
|
|
829
|
+
:attr str dashboard_url: (optional) The URL of a web-based management user
|
|
830
|
+
interface for the service instance; we refer to this as a service dashboard. The
|
|
831
|
+
URL MUST contain enough information for the dashboard to identify the resource
|
|
832
|
+
being accessed. Note: a broker that wishes to return `dashboard_url` for a
|
|
833
|
+
service instance MUST return it with the initial response to the provision
|
|
834
|
+
request, even if the service is provisioned asynchronously. If present, it MUST
|
|
835
|
+
be a non-empty string.
|
|
836
|
+
:attr str operation: (optional) For asynchronous responses, service brokers MAY
|
|
837
|
+
return an identifier representing the operation. The value of this field MUST be
|
|
838
|
+
provided by the platform with requests to the `last_operation` endpoint in a URL
|
|
839
|
+
encoded query parameter. If present, MUST be a non-empty string.
|
|
840
|
+
"""
|
|
841
|
+
|
|
842
|
+
def __init__(self, *, dashboard_url: str = None, operation: str = None) -> None:
|
|
843
|
+
"""
|
|
844
|
+
Initialize a Resp2079872Root object.
|
|
845
|
+
|
|
846
|
+
:param str dashboard_url: (optional) The URL of a web-based management user
|
|
847
|
+
interface for the service instance; we refer to this as a service
|
|
848
|
+
dashboard. The URL MUST contain enough information for the dashboard to
|
|
849
|
+
identify the resource being accessed. Note: a broker that wishes to return
|
|
850
|
+
`dashboard_url` for a service instance MUST return it with the initial
|
|
851
|
+
response to the provision request, even if the service is provisioned
|
|
852
|
+
asynchronously. If present, it MUST be a non-empty string.
|
|
853
|
+
:param str operation: (optional) For asynchronous responses, service
|
|
854
|
+
brokers MAY return an identifier representing the operation. The value of
|
|
855
|
+
this field MUST be provided by the platform with requests to the
|
|
856
|
+
`last_operation` endpoint in a URL encoded query parameter. If present,
|
|
857
|
+
MUST be a non-empty string.
|
|
858
|
+
"""
|
|
859
|
+
self.dashboard_url = dashboard_url
|
|
860
|
+
self.operation = operation
|
|
861
|
+
|
|
862
|
+
@classmethod
|
|
863
|
+
def from_dict(cls, _dict: Dict) -> 'Resp2079872Root':
|
|
864
|
+
"""Initialize a Resp2079872Root object from a json dictionary."""
|
|
865
|
+
args = {}
|
|
866
|
+
if 'dashboard_url' in _dict:
|
|
867
|
+
args['dashboard_url'] = _dict.get('dashboard_url')
|
|
868
|
+
if 'operation' in _dict:
|
|
869
|
+
args['operation'] = _dict.get('operation')
|
|
870
|
+
return cls(**args)
|
|
871
|
+
|
|
872
|
+
@classmethod
|
|
873
|
+
def _from_dict(cls, _dict):
|
|
874
|
+
"""Initialize a Resp2079872Root object from a json dictionary."""
|
|
875
|
+
return cls.from_dict(_dict)
|
|
876
|
+
|
|
877
|
+
def to_dict(self) -> Dict:
|
|
878
|
+
"""Return a json dictionary representing this model."""
|
|
879
|
+
_dict = {}
|
|
880
|
+
if hasattr(self, 'dashboard_url') and self.dashboard_url is not None:
|
|
881
|
+
_dict['dashboard_url'] = self.dashboard_url
|
|
882
|
+
if hasattr(self, 'operation') and self.operation is not None:
|
|
883
|
+
_dict['operation'] = self.operation
|
|
884
|
+
return _dict
|
|
885
|
+
|
|
886
|
+
def _to_dict(self):
|
|
887
|
+
"""Return a json dictionary representing this model."""
|
|
888
|
+
return self.to_dict()
|
|
889
|
+
|
|
890
|
+
def __str__(self) -> str:
|
|
891
|
+
"""Return a `str` version of this Resp2079872Root object."""
|
|
892
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
893
|
+
|
|
894
|
+
def __eq__(self, other: 'Resp2079872Root') -> bool:
|
|
895
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
896
|
+
if not isinstance(other, self.__class__):
|
|
897
|
+
return False
|
|
898
|
+
return self.__dict__ == other.__dict__
|
|
899
|
+
|
|
900
|
+
def __ne__(self, other: 'Resp2079872Root') -> bool:
|
|
901
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
902
|
+
return not self == other
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
class Resp2079874Root:
|
|
906
|
+
"""
|
|
907
|
+
Accepted - MUST be returned if the service instance provisioning is in progress. This
|
|
908
|
+
triggers the IBM Cloud platform to poll the Service Instance `last_operation` Endpoint
|
|
909
|
+
for operation status. Note that a re-sent `PUT` request MUST return a `202 Accepted`,
|
|
910
|
+
not a `200 OK`, if the service instance is not yet fully provisioned.
|
|
911
|
+
|
|
912
|
+
:attr str operation: (optional) For asynchronous responses, service brokers MAY
|
|
913
|
+
return an identifier representing the operation. The value of this field MUST be
|
|
914
|
+
provided by the platform with requests to the Last Operation endpoint in a URL
|
|
915
|
+
encoded query parameter. If present, MUST be a non-empty string.
|
|
916
|
+
"""
|
|
917
|
+
|
|
918
|
+
def __init__(self, *, operation: str = None) -> None:
|
|
919
|
+
"""
|
|
920
|
+
Initialize a Resp2079874Root object.
|
|
921
|
+
|
|
922
|
+
:param str operation: (optional) For asynchronous responses, service
|
|
923
|
+
brokers MAY return an identifier representing the operation. The value of
|
|
924
|
+
this field MUST be provided by the platform with requests to the Last
|
|
925
|
+
Operation endpoint in a URL encoded query parameter. If present, MUST be a
|
|
926
|
+
non-empty string.
|
|
927
|
+
"""
|
|
928
|
+
self.operation = operation
|
|
929
|
+
|
|
930
|
+
@classmethod
|
|
931
|
+
def from_dict(cls, _dict: Dict) -> 'Resp2079874Root':
|
|
932
|
+
"""Initialize a Resp2079874Root object from a json dictionary."""
|
|
933
|
+
args = {}
|
|
934
|
+
if 'operation' in _dict:
|
|
935
|
+
args['operation'] = _dict.get('operation')
|
|
936
|
+
return cls(**args)
|
|
937
|
+
|
|
938
|
+
@classmethod
|
|
939
|
+
def _from_dict(cls, _dict):
|
|
940
|
+
"""Initialize a Resp2079874Root object from a json dictionary."""
|
|
941
|
+
return cls.from_dict(_dict)
|
|
942
|
+
|
|
943
|
+
def to_dict(self) -> Dict:
|
|
944
|
+
"""Return a json dictionary representing this model."""
|
|
945
|
+
_dict = {}
|
|
946
|
+
if hasattr(self, 'operation') and self.operation is not None:
|
|
947
|
+
_dict['operation'] = self.operation
|
|
948
|
+
return _dict
|
|
949
|
+
|
|
950
|
+
def _to_dict(self):
|
|
951
|
+
"""Return a json dictionary representing this model."""
|
|
952
|
+
return self.to_dict()
|
|
953
|
+
|
|
954
|
+
def __str__(self) -> str:
|
|
955
|
+
"""Return a `str` version of this Resp2079874Root object."""
|
|
956
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
957
|
+
|
|
958
|
+
def __eq__(self, other: 'Resp2079874Root') -> bool:
|
|
959
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
960
|
+
if not isinstance(other, self.__class__):
|
|
961
|
+
return False
|
|
962
|
+
return self.__dict__ == other.__dict__
|
|
963
|
+
|
|
964
|
+
def __ne__(self, other: 'Resp2079874Root') -> bool:
|
|
965
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
966
|
+
return not self == other
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
class Resp2079876Root:
|
|
970
|
+
"""
|
|
971
|
+
Resp2079876Root.
|
|
972
|
+
|
|
973
|
+
:attr object credentials: (optional) A free-form hash of credentials that can be
|
|
974
|
+
used by applications or users to access the service.
|
|
975
|
+
:attr str syslog_drain_url: (optional) A URL to which logs MUST be streamed.
|
|
976
|
+
'requires':['syslog_drain'] MUST be declared in the Catalog endpoint or the
|
|
977
|
+
platform MUST consider the response invalid.
|
|
978
|
+
:attr str route_service_url: (optional) A URL to which the platform MUST proxy
|
|
979
|
+
requests for the address sent with bind_resource.route in the request body.
|
|
980
|
+
'requires':['route_forwarding'] MUST be declared in the Catalog endpoint or the
|
|
981
|
+
platform can consider the response invalid.
|
|
982
|
+
:attr List[VolumeMount] volume_mounts: (optional) An array of configuration for
|
|
983
|
+
remote storage devices to be mounted into an application container filesystem.
|
|
984
|
+
'requires':['volume_mount'] MUST be declared in the Catalog endpoint or the
|
|
985
|
+
platform can consider the response invalid.
|
|
986
|
+
"""
|
|
987
|
+
|
|
988
|
+
def __init__(
|
|
989
|
+
self,
|
|
990
|
+
*,
|
|
991
|
+
credentials: object = None,
|
|
992
|
+
syslog_drain_url: str = None,
|
|
993
|
+
route_service_url: str = None,
|
|
994
|
+
volume_mounts: List['VolumeMount'] = None,
|
|
995
|
+
) -> None:
|
|
996
|
+
"""
|
|
997
|
+
Initialize a Resp2079876Root object.
|
|
998
|
+
|
|
999
|
+
:param object credentials: (optional) A free-form hash of credentials that
|
|
1000
|
+
can be used by applications or users to access the service.
|
|
1001
|
+
:param str syslog_drain_url: (optional) A URL to which logs MUST be
|
|
1002
|
+
streamed. 'requires':['syslog_drain'] MUST be declared in the Catalog
|
|
1003
|
+
endpoint or the platform MUST consider the response invalid.
|
|
1004
|
+
:param str route_service_url: (optional) A URL to which the platform MUST
|
|
1005
|
+
proxy requests for the address sent with bind_resource.route in the request
|
|
1006
|
+
body. 'requires':['route_forwarding'] MUST be declared in the Catalog
|
|
1007
|
+
endpoint or the platform can consider the response invalid.
|
|
1008
|
+
:param List[VolumeMount] volume_mounts: (optional) An array of
|
|
1009
|
+
configuration for remote storage devices to be mounted into an application
|
|
1010
|
+
container filesystem. 'requires':['volume_mount'] MUST be declared in the
|
|
1011
|
+
Catalog endpoint or the platform can consider the response invalid.
|
|
1012
|
+
"""
|
|
1013
|
+
self.credentials = credentials
|
|
1014
|
+
self.syslog_drain_url = syslog_drain_url
|
|
1015
|
+
self.route_service_url = route_service_url
|
|
1016
|
+
self.volume_mounts = volume_mounts
|
|
1017
|
+
|
|
1018
|
+
@classmethod
|
|
1019
|
+
def from_dict(cls, _dict: Dict) -> 'Resp2079876Root':
|
|
1020
|
+
"""Initialize a Resp2079876Root object from a json dictionary."""
|
|
1021
|
+
args = {}
|
|
1022
|
+
if 'credentials' in _dict:
|
|
1023
|
+
args['credentials'] = _dict.get('credentials')
|
|
1024
|
+
if 'syslog_drain_url' in _dict:
|
|
1025
|
+
args['syslog_drain_url'] = _dict.get('syslog_drain_url')
|
|
1026
|
+
if 'route_service_url' in _dict:
|
|
1027
|
+
args['route_service_url'] = _dict.get('route_service_url')
|
|
1028
|
+
if 'volume_mounts' in _dict:
|
|
1029
|
+
args['volume_mounts'] = [VolumeMount.from_dict(x) for x in _dict.get('volume_mounts')]
|
|
1030
|
+
return cls(**args)
|
|
1031
|
+
|
|
1032
|
+
@classmethod
|
|
1033
|
+
def _from_dict(cls, _dict):
|
|
1034
|
+
"""Initialize a Resp2079876Root object from a json dictionary."""
|
|
1035
|
+
return cls.from_dict(_dict)
|
|
1036
|
+
|
|
1037
|
+
def to_dict(self) -> Dict:
|
|
1038
|
+
"""Return a json dictionary representing this model."""
|
|
1039
|
+
_dict = {}
|
|
1040
|
+
if hasattr(self, 'credentials') and self.credentials is not None:
|
|
1041
|
+
_dict['credentials'] = self.credentials
|
|
1042
|
+
if hasattr(self, 'syslog_drain_url') and self.syslog_drain_url is not None:
|
|
1043
|
+
_dict['syslog_drain_url'] = self.syslog_drain_url
|
|
1044
|
+
if hasattr(self, 'route_service_url') and self.route_service_url is not None:
|
|
1045
|
+
_dict['route_service_url'] = self.route_service_url
|
|
1046
|
+
if hasattr(self, 'volume_mounts') and self.volume_mounts is not None:
|
|
1047
|
+
_dict['volume_mounts'] = [x.to_dict() for x in self.volume_mounts]
|
|
1048
|
+
return _dict
|
|
1049
|
+
|
|
1050
|
+
def _to_dict(self):
|
|
1051
|
+
"""Return a json dictionary representing this model."""
|
|
1052
|
+
return self.to_dict()
|
|
1053
|
+
|
|
1054
|
+
def __str__(self) -> str:
|
|
1055
|
+
"""Return a `str` version of this Resp2079876Root object."""
|
|
1056
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
1057
|
+
|
|
1058
|
+
def __eq__(self, other: 'Resp2079876Root') -> bool:
|
|
1059
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
1060
|
+
if not isinstance(other, self.__class__):
|
|
1061
|
+
return False
|
|
1062
|
+
return self.__dict__ == other.__dict__
|
|
1063
|
+
|
|
1064
|
+
def __ne__(self, other: 'Resp2079876Root') -> bool:
|
|
1065
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
1066
|
+
return not self == other
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
class Resp2079894Root:
|
|
1070
|
+
"""
|
|
1071
|
+
OK - MUST be returned upon successful processing of this request.
|
|
1072
|
+
|
|
1073
|
+
:attr str description: (optional) A user-facing message displayed to the
|
|
1074
|
+
platform API client. Can be used to tell the user details about the status of
|
|
1075
|
+
the operation. If present, MUST be a non-empty string.
|
|
1076
|
+
:attr str state: Valid values are `in progress`, `succeeded`, and `failed`.
|
|
1077
|
+
While `†state": "in progress†`, the platform SHOULD continue polling. A
|
|
1078
|
+
response with `†state": "succeeded†` or `†state": "failed†` MUST cause
|
|
1079
|
+
the platform to cease polling.
|
|
1080
|
+
"""
|
|
1081
|
+
|
|
1082
|
+
def __init__(self, state: str, *, description: str = None) -> None:
|
|
1083
|
+
"""
|
|
1084
|
+
Initialize a Resp2079894Root object.
|
|
1085
|
+
|
|
1086
|
+
:param str state: Valid values are `in progress`, `succeeded`, and
|
|
1087
|
+
`failed`. While `†state": "in progress†`, the platform SHOULD continue
|
|
1088
|
+
polling. A response with `†state": "succeeded†` or `†state":
|
|
1089
|
+
"failed†` MUST cause the platform to cease polling.
|
|
1090
|
+
:param str description: (optional) A user-facing message displayed to the
|
|
1091
|
+
platform API client. Can be used to tell the user details about the status
|
|
1092
|
+
of the operation. If present, MUST be a non-empty string.
|
|
1093
|
+
"""
|
|
1094
|
+
self.description = description
|
|
1095
|
+
self.state = state
|
|
1096
|
+
|
|
1097
|
+
@classmethod
|
|
1098
|
+
def from_dict(cls, _dict: Dict) -> 'Resp2079894Root':
|
|
1099
|
+
"""Initialize a Resp2079894Root object from a json dictionary."""
|
|
1100
|
+
args = {}
|
|
1101
|
+
if 'description' in _dict:
|
|
1102
|
+
args['description'] = _dict.get('description')
|
|
1103
|
+
if 'state' in _dict:
|
|
1104
|
+
args['state'] = _dict.get('state')
|
|
1105
|
+
else:
|
|
1106
|
+
raise ValueError('Required property \'state\' not present in Resp2079894Root JSON')
|
|
1107
|
+
return cls(**args)
|
|
1108
|
+
|
|
1109
|
+
@classmethod
|
|
1110
|
+
def _from_dict(cls, _dict):
|
|
1111
|
+
"""Initialize a Resp2079894Root object from a json dictionary."""
|
|
1112
|
+
return cls.from_dict(_dict)
|
|
1113
|
+
|
|
1114
|
+
def to_dict(self) -> Dict:
|
|
1115
|
+
"""Return a json dictionary representing this model."""
|
|
1116
|
+
_dict = {}
|
|
1117
|
+
if hasattr(self, 'description') and self.description is not None:
|
|
1118
|
+
_dict['description'] = self.description
|
|
1119
|
+
if hasattr(self, 'state') and self.state is not None:
|
|
1120
|
+
_dict['state'] = self.state
|
|
1121
|
+
return _dict
|
|
1122
|
+
|
|
1123
|
+
def _to_dict(self):
|
|
1124
|
+
"""Return a json dictionary representing this model."""
|
|
1125
|
+
return self.to_dict()
|
|
1126
|
+
|
|
1127
|
+
def __str__(self) -> str:
|
|
1128
|
+
"""Return a `str` version of this Resp2079894Root object."""
|
|
1129
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
1130
|
+
|
|
1131
|
+
def __eq__(self, other: 'Resp2079894Root') -> bool:
|
|
1132
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
1133
|
+
if not isinstance(other, self.__class__):
|
|
1134
|
+
return False
|
|
1135
|
+
return self.__dict__ == other.__dict__
|
|
1136
|
+
|
|
1137
|
+
def __ne__(self, other: 'Resp2079894Root') -> bool:
|
|
1138
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
1139
|
+
return not self == other
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
class Resp2448145Root:
|
|
1143
|
+
"""
|
|
1144
|
+
Check the enabled status of active service.
|
|
1145
|
+
|
|
1146
|
+
:attr bool active: (optional) Indicates (from the viewpoint of the provider)
|
|
1147
|
+
whether the service instance is active and is meaningful if `enabled` is true.
|
|
1148
|
+
The default value is true if not specified.
|
|
1149
|
+
:attr bool enabled: Indicates the current state of the service instance.
|
|
1150
|
+
:attr int last_active: (optional) Indicates when the service instance was last
|
|
1151
|
+
accessed or modified, and is meaningful if `enabled` is true AND `active` is
|
|
1152
|
+
false. Represented as milliseconds since the epoch, but does not need to be
|
|
1153
|
+
accurate to the second/hour.
|
|
1154
|
+
"""
|
|
1155
|
+
|
|
1156
|
+
def __init__(self, enabled: bool, *, active: bool = None, last_active: int = None) -> None:
|
|
1157
|
+
"""
|
|
1158
|
+
Initialize a Resp2448145Root object.
|
|
1159
|
+
|
|
1160
|
+
:param bool enabled: Indicates the current state of the service instance.
|
|
1161
|
+
:param bool active: (optional) Indicates (from the viewpoint of the
|
|
1162
|
+
provider) whether the service instance is active and is meaningful if
|
|
1163
|
+
`enabled` is true. The default value is true if not specified.
|
|
1164
|
+
:param int last_active: (optional) Indicates when the service instance was
|
|
1165
|
+
last accessed or modified, and is meaningful if `enabled` is true AND
|
|
1166
|
+
`active` is false. Represented as milliseconds since the epoch, but does
|
|
1167
|
+
not need to be accurate to the second/hour.
|
|
1168
|
+
"""
|
|
1169
|
+
self.active = active
|
|
1170
|
+
self.enabled = enabled
|
|
1171
|
+
self.last_active = last_active
|
|
1172
|
+
|
|
1173
|
+
@classmethod
|
|
1174
|
+
def from_dict(cls, _dict: Dict) -> 'Resp2448145Root':
|
|
1175
|
+
"""Initialize a Resp2448145Root object from a json dictionary."""
|
|
1176
|
+
args = {}
|
|
1177
|
+
if 'active' in _dict:
|
|
1178
|
+
args['active'] = _dict.get('active')
|
|
1179
|
+
if 'enabled' in _dict:
|
|
1180
|
+
args['enabled'] = _dict.get('enabled')
|
|
1181
|
+
else:
|
|
1182
|
+
raise ValueError('Required property \'enabled\' not present in Resp2448145Root JSON')
|
|
1183
|
+
if 'last_active' in _dict:
|
|
1184
|
+
args['last_active'] = _dict.get('last_active')
|
|
1185
|
+
return cls(**args)
|
|
1186
|
+
|
|
1187
|
+
@classmethod
|
|
1188
|
+
def _from_dict(cls, _dict):
|
|
1189
|
+
"""Initialize a Resp2448145Root object from a json dictionary."""
|
|
1190
|
+
return cls.from_dict(_dict)
|
|
1191
|
+
|
|
1192
|
+
def to_dict(self) -> Dict:
|
|
1193
|
+
"""Return a json dictionary representing this model."""
|
|
1194
|
+
_dict = {}
|
|
1195
|
+
if hasattr(self, 'active') and self.active is not None:
|
|
1196
|
+
_dict['active'] = self.active
|
|
1197
|
+
if hasattr(self, 'enabled') and self.enabled is not None:
|
|
1198
|
+
_dict['enabled'] = self.enabled
|
|
1199
|
+
if hasattr(self, 'last_active') and self.last_active is not None:
|
|
1200
|
+
_dict['last_active'] = self.last_active
|
|
1201
|
+
return _dict
|
|
1202
|
+
|
|
1203
|
+
def _to_dict(self):
|
|
1204
|
+
"""Return a json dictionary representing this model."""
|
|
1205
|
+
return self.to_dict()
|
|
1206
|
+
|
|
1207
|
+
def __str__(self) -> str:
|
|
1208
|
+
"""Return a `str` version of this Resp2448145Root object."""
|
|
1209
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
1210
|
+
|
|
1211
|
+
def __eq__(self, other: 'Resp2448145Root') -> bool:
|
|
1212
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
1213
|
+
if not isinstance(other, self.__class__):
|
|
1214
|
+
return False
|
|
1215
|
+
return self.__dict__ == other.__dict__
|
|
1216
|
+
|
|
1217
|
+
def __ne__(self, other: 'Resp2448145Root') -> bool:
|
|
1218
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
1219
|
+
return not self == other
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
class BindResource:
|
|
1223
|
+
"""
|
|
1224
|
+
A JSON object that contains data for platform resources associated with the binding to
|
|
1225
|
+
be created.
|
|
1226
|
+
|
|
1227
|
+
:attr str account_id: (optional) Account owner of resource to bind.
|
|
1228
|
+
:attr str serviceid_crn: (optional) Service ID of resource to bind.
|
|
1229
|
+
:attr str target_crn: (optional) Target ID of resource to bind.
|
|
1230
|
+
:attr str app_guid: (optional) GUID of an application associated with the
|
|
1231
|
+
binding. For credentials bindings.
|
|
1232
|
+
:attr str route: (optional) URL of the application to be intermediated. For
|
|
1233
|
+
route services bindings.
|
|
1234
|
+
"""
|
|
1235
|
+
|
|
1236
|
+
def __init__(
|
|
1237
|
+
self,
|
|
1238
|
+
*,
|
|
1239
|
+
account_id: str = None,
|
|
1240
|
+
serviceid_crn: str = None,
|
|
1241
|
+
target_crn: str = None,
|
|
1242
|
+
app_guid: str = None,
|
|
1243
|
+
route: str = None,
|
|
1244
|
+
) -> None:
|
|
1245
|
+
"""
|
|
1246
|
+
Initialize a BindResource object.
|
|
1247
|
+
|
|
1248
|
+
:param str account_id: (optional) Account owner of resource to bind.
|
|
1249
|
+
:param str serviceid_crn: (optional) Service ID of resource to bind.
|
|
1250
|
+
:param str target_crn: (optional) Target ID of resource to bind.
|
|
1251
|
+
:param str app_guid: (optional) GUID of an application associated with the
|
|
1252
|
+
binding. For credentials bindings.
|
|
1253
|
+
:param str route: (optional) URL of the application to be intermediated.
|
|
1254
|
+
For route services bindings.
|
|
1255
|
+
"""
|
|
1256
|
+
self.account_id = account_id
|
|
1257
|
+
self.serviceid_crn = serviceid_crn
|
|
1258
|
+
self.target_crn = target_crn
|
|
1259
|
+
self.app_guid = app_guid
|
|
1260
|
+
self.route = route
|
|
1261
|
+
|
|
1262
|
+
@classmethod
|
|
1263
|
+
def from_dict(cls, _dict: Dict) -> 'BindResource':
|
|
1264
|
+
"""Initialize a BindResource object from a json dictionary."""
|
|
1265
|
+
args = {}
|
|
1266
|
+
if 'account_id' in _dict:
|
|
1267
|
+
args['account_id'] = _dict.get('account_id')
|
|
1268
|
+
if 'serviceid_crn' in _dict:
|
|
1269
|
+
args['serviceid_crn'] = _dict.get('serviceid_crn')
|
|
1270
|
+
if 'target_crn' in _dict:
|
|
1271
|
+
args['target_crn'] = _dict.get('target_crn')
|
|
1272
|
+
if 'app_guid' in _dict:
|
|
1273
|
+
args['app_guid'] = _dict.get('app_guid')
|
|
1274
|
+
if 'route' in _dict:
|
|
1275
|
+
args['route'] = _dict.get('route')
|
|
1276
|
+
return cls(**args)
|
|
1277
|
+
|
|
1278
|
+
@classmethod
|
|
1279
|
+
def _from_dict(cls, _dict):
|
|
1280
|
+
"""Initialize a BindResource object from a json dictionary."""
|
|
1281
|
+
return cls.from_dict(_dict)
|
|
1282
|
+
|
|
1283
|
+
def to_dict(self) -> Dict:
|
|
1284
|
+
"""Return a json dictionary representing this model."""
|
|
1285
|
+
_dict = {}
|
|
1286
|
+
if hasattr(self, 'account_id') and self.account_id is not None:
|
|
1287
|
+
_dict['account_id'] = self.account_id
|
|
1288
|
+
if hasattr(self, 'serviceid_crn') and self.serviceid_crn is not None:
|
|
1289
|
+
_dict['serviceid_crn'] = self.serviceid_crn
|
|
1290
|
+
if hasattr(self, 'target_crn') and self.target_crn is not None:
|
|
1291
|
+
_dict['target_crn'] = self.target_crn
|
|
1292
|
+
if hasattr(self, 'app_guid') and self.app_guid is not None:
|
|
1293
|
+
_dict['app_guid'] = self.app_guid
|
|
1294
|
+
if hasattr(self, 'route') and self.route is not None:
|
|
1295
|
+
_dict['route'] = self.route
|
|
1296
|
+
return _dict
|
|
1297
|
+
|
|
1298
|
+
def _to_dict(self):
|
|
1299
|
+
"""Return a json dictionary representing this model."""
|
|
1300
|
+
return self.to_dict()
|
|
1301
|
+
|
|
1302
|
+
def __str__(self) -> str:
|
|
1303
|
+
"""Return a `str` version of this BindResource object."""
|
|
1304
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
1305
|
+
|
|
1306
|
+
def __eq__(self, other: 'BindResource') -> bool:
|
|
1307
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
1308
|
+
if not isinstance(other, self.__class__):
|
|
1309
|
+
return False
|
|
1310
|
+
return self.__dict__ == other.__dict__
|
|
1311
|
+
|
|
1312
|
+
def __ne__(self, other: 'BindResource') -> bool:
|
|
1313
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
1314
|
+
return not self == other
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
class Context:
|
|
1318
|
+
"""
|
|
1319
|
+
Platform specific contextual information under which the service instance is to be
|
|
1320
|
+
provisioned.
|
|
1321
|
+
|
|
1322
|
+
:attr str account_id: (optional) Returns the ID of the account in IBM Cloud that
|
|
1323
|
+
is provisioning the service instance.
|
|
1324
|
+
:attr str crn: (optional) When a customer provisions your service in IBM Cloud,
|
|
1325
|
+
a service instance is created and this instance is identified by its IBM Cloud
|
|
1326
|
+
Resource Name (CRN). The CRN is utilized in all aspects of the interaction with
|
|
1327
|
+
IBM Cloud including provisioning, binding (creating credentials and endpoints),
|
|
1328
|
+
metering, dashboard display, and access control. From a service provider
|
|
1329
|
+
perspective, the CRN can largely be treated as an opaque string to be utilized
|
|
1330
|
+
with the IBM Cloud APIs, but it can also be decomposed via the following
|
|
1331
|
+
structure:
|
|
1332
|
+
`crn:version:cname:ctype:service-name:location:scope:service-instance:resource-type:resource`.
|
|
1333
|
+
:attr str platform: (optional) Identifies the platform as "ibmcloud".
|
|
1334
|
+
"""
|
|
1335
|
+
|
|
1336
|
+
def __init__(self, *, account_id: str = None, crn: str = None, platform: str = None) -> None:
|
|
1337
|
+
"""
|
|
1338
|
+
Initialize a Context object.
|
|
1339
|
+
|
|
1340
|
+
:param str account_id: (optional) Returns the ID of the account in IBM
|
|
1341
|
+
Cloud that is provisioning the service instance.
|
|
1342
|
+
:param str crn: (optional) When a customer provisions your service in IBM
|
|
1343
|
+
Cloud, a service instance is created and this instance is identified by its
|
|
1344
|
+
IBM Cloud Resource Name (CRN). The CRN is utilized in all aspects of the
|
|
1345
|
+
interaction with IBM Cloud including provisioning, binding (creating
|
|
1346
|
+
credentials and endpoints), metering, dashboard display, and access
|
|
1347
|
+
control. From a service provider perspective, the CRN can largely be
|
|
1348
|
+
treated as an opaque string to be utilized with the IBM Cloud APIs, but it
|
|
1349
|
+
can also be decomposed via the following structure:
|
|
1350
|
+
`crn:version:cname:ctype:service-name:location:scope:service-instance:resource-type:resource`.
|
|
1351
|
+
:param str platform: (optional) Identifies the platform as "ibmcloud".
|
|
1352
|
+
"""
|
|
1353
|
+
self.account_id = account_id
|
|
1354
|
+
self.crn = crn
|
|
1355
|
+
self.platform = platform
|
|
1356
|
+
|
|
1357
|
+
@classmethod
|
|
1358
|
+
def from_dict(cls, _dict: Dict) -> 'Context':
|
|
1359
|
+
"""Initialize a Context object from a json dictionary."""
|
|
1360
|
+
args = {}
|
|
1361
|
+
if 'account_id' in _dict:
|
|
1362
|
+
args['account_id'] = _dict.get('account_id')
|
|
1363
|
+
if 'crn' in _dict:
|
|
1364
|
+
args['crn'] = _dict.get('crn')
|
|
1365
|
+
if 'platform' in _dict:
|
|
1366
|
+
args['platform'] = _dict.get('platform')
|
|
1367
|
+
return cls(**args)
|
|
1368
|
+
|
|
1369
|
+
@classmethod
|
|
1370
|
+
def _from_dict(cls, _dict):
|
|
1371
|
+
"""Initialize a Context object from a json dictionary."""
|
|
1372
|
+
return cls.from_dict(_dict)
|
|
1373
|
+
|
|
1374
|
+
def to_dict(self) -> Dict:
|
|
1375
|
+
"""Return a json dictionary representing this model."""
|
|
1376
|
+
_dict = {}
|
|
1377
|
+
if hasattr(self, 'account_id') and self.account_id is not None:
|
|
1378
|
+
_dict['account_id'] = self.account_id
|
|
1379
|
+
if hasattr(self, 'crn') and self.crn is not None:
|
|
1380
|
+
_dict['crn'] = self.crn
|
|
1381
|
+
if hasattr(self, 'platform') and self.platform is not None:
|
|
1382
|
+
_dict['platform'] = self.platform
|
|
1383
|
+
return _dict
|
|
1384
|
+
|
|
1385
|
+
def _to_dict(self):
|
|
1386
|
+
"""Return a json dictionary representing this model."""
|
|
1387
|
+
return self.to_dict()
|
|
1388
|
+
|
|
1389
|
+
def __str__(self) -> str:
|
|
1390
|
+
"""Return a `str` version of this Context object."""
|
|
1391
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
1392
|
+
|
|
1393
|
+
def __eq__(self, other: 'Context') -> bool:
|
|
1394
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
1395
|
+
if not isinstance(other, self.__class__):
|
|
1396
|
+
return False
|
|
1397
|
+
return self.__dict__ == other.__dict__
|
|
1398
|
+
|
|
1399
|
+
def __ne__(self, other: 'Context') -> bool:
|
|
1400
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
1401
|
+
return not self == other
|
|
1402
|
+
|
|
1403
|
+
|
|
1404
|
+
class Plans:
|
|
1405
|
+
"""
|
|
1406
|
+
Where is this in the source?.
|
|
1407
|
+
|
|
1408
|
+
:attr str description: A short description of the plan. It MUST be a non-empty
|
|
1409
|
+
string. The description is NOT displayed in the IBM Cloud catalog or IBM Cloud
|
|
1410
|
+
CLI.
|
|
1411
|
+
:attr bool free: (optional) When false, service instances of this plan have a
|
|
1412
|
+
cost. The default is true.
|
|
1413
|
+
:attr str id: An identifier used to correlate this plan in future requests to
|
|
1414
|
+
the broker. This MUST be globally unique within a platform marketplace. It MUST
|
|
1415
|
+
be a non-empty string and using a GUID is RECOMMENDED. If you define your
|
|
1416
|
+
service in the RMC, it will create a unique GUID for you to use. It is
|
|
1417
|
+
recommended to use the RMC to define and generate these values and then use them
|
|
1418
|
+
in your catalog.json metadata in your broker. This value is NOT displayed in the
|
|
1419
|
+
IBM Cloud catalog or IBM Cloud CLI.
|
|
1420
|
+
:attr str name: The programmatic name of the plan. It MUST be unique within the
|
|
1421
|
+
service. All lowercase, no spaces. It MUST be a non-empty string, and it's NOT
|
|
1422
|
+
displayed in the IBM Cloud catalog or IBM Cloud CLI.
|
|
1423
|
+
"""
|
|
1424
|
+
|
|
1425
|
+
def __init__(self, description: str, id: str, name: str, *, free: bool = None) -> None:
|
|
1426
|
+
"""
|
|
1427
|
+
Initialize a Plans object.
|
|
1428
|
+
|
|
1429
|
+
:param str description: A short description of the plan. It MUST be a
|
|
1430
|
+
non-empty string. The description is NOT displayed in the IBM Cloud catalog
|
|
1431
|
+
or IBM Cloud CLI.
|
|
1432
|
+
:param str id: An identifier used to correlate this plan in future requests
|
|
1433
|
+
to the broker. This MUST be globally unique within a platform marketplace.
|
|
1434
|
+
It MUST be a non-empty string and using a GUID is RECOMMENDED. If you
|
|
1435
|
+
define your service in the RMC, it will create a unique GUID for you to
|
|
1436
|
+
use. It is recommended to use the RMC to define and generate these values
|
|
1437
|
+
and then use them in your catalog.json metadata in your broker. This value
|
|
1438
|
+
is NOT displayed in the IBM Cloud catalog or IBM Cloud CLI.
|
|
1439
|
+
:param str name: The programmatic name of the plan. It MUST be unique
|
|
1440
|
+
within the service. All lowercase, no spaces. It MUST be a non-empty
|
|
1441
|
+
string, and it's NOT displayed in the IBM Cloud catalog or IBM Cloud CLI.
|
|
1442
|
+
:param bool free: (optional) When false, service instances of this plan
|
|
1443
|
+
have a cost. The default is true.
|
|
1444
|
+
"""
|
|
1445
|
+
self.description = description
|
|
1446
|
+
self.free = free
|
|
1447
|
+
self.id = id
|
|
1448
|
+
self.name = name
|
|
1449
|
+
|
|
1450
|
+
@classmethod
|
|
1451
|
+
def from_dict(cls, _dict: Dict) -> 'Plans':
|
|
1452
|
+
"""Initialize a Plans object from a json dictionary."""
|
|
1453
|
+
args = {}
|
|
1454
|
+
if 'description' in _dict:
|
|
1455
|
+
args['description'] = _dict.get('description')
|
|
1456
|
+
else:
|
|
1457
|
+
raise ValueError('Required property \'description\' not present in Plans JSON')
|
|
1458
|
+
if 'free' in _dict:
|
|
1459
|
+
args['free'] = _dict.get('free')
|
|
1460
|
+
if 'id' in _dict:
|
|
1461
|
+
args['id'] = _dict.get('id')
|
|
1462
|
+
else:
|
|
1463
|
+
raise ValueError('Required property \'id\' not present in Plans JSON')
|
|
1464
|
+
if 'name' in _dict:
|
|
1465
|
+
args['name'] = _dict.get('name')
|
|
1466
|
+
else:
|
|
1467
|
+
raise ValueError('Required property \'name\' not present in Plans JSON')
|
|
1468
|
+
return cls(**args)
|
|
1469
|
+
|
|
1470
|
+
@classmethod
|
|
1471
|
+
def _from_dict(cls, _dict):
|
|
1472
|
+
"""Initialize a Plans object from a json dictionary."""
|
|
1473
|
+
return cls.from_dict(_dict)
|
|
1474
|
+
|
|
1475
|
+
def to_dict(self) -> Dict:
|
|
1476
|
+
"""Return a json dictionary representing this model."""
|
|
1477
|
+
_dict = {}
|
|
1478
|
+
if hasattr(self, 'description') and self.description is not None:
|
|
1479
|
+
_dict['description'] = self.description
|
|
1480
|
+
if hasattr(self, 'free') and self.free is not None:
|
|
1481
|
+
_dict['free'] = self.free
|
|
1482
|
+
if hasattr(self, 'id') and self.id is not None:
|
|
1483
|
+
_dict['id'] = self.id
|
|
1484
|
+
if hasattr(self, 'name') and self.name is not None:
|
|
1485
|
+
_dict['name'] = self.name
|
|
1486
|
+
return _dict
|
|
1487
|
+
|
|
1488
|
+
def _to_dict(self):
|
|
1489
|
+
"""Return a json dictionary representing this model."""
|
|
1490
|
+
return self.to_dict()
|
|
1491
|
+
|
|
1492
|
+
def __str__(self) -> str:
|
|
1493
|
+
"""Return a `str` version of this Plans object."""
|
|
1494
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
1495
|
+
|
|
1496
|
+
def __eq__(self, other: 'Plans') -> bool:
|
|
1497
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
1498
|
+
if not isinstance(other, self.__class__):
|
|
1499
|
+
return False
|
|
1500
|
+
return self.__dict__ == other.__dict__
|
|
1501
|
+
|
|
1502
|
+
def __ne__(self, other: 'Plans') -> bool:
|
|
1503
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
1504
|
+
return not self == other
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
class Services:
|
|
1508
|
+
"""
|
|
1509
|
+
The service object that describes the properties of your service.
|
|
1510
|
+
|
|
1511
|
+
:attr bool bindable: Specifies whether or not your service can be bound to
|
|
1512
|
+
applications in IBM Cloud. If bindable, it must be able to return API endpoints
|
|
1513
|
+
and credentials to your service consumers.
|
|
1514
|
+
:attr str description: A short description of the service. It MUST be a
|
|
1515
|
+
non-empty string. Note that this description is not displayed by the the IBM
|
|
1516
|
+
Cloud console or IBM Cloud CLI.
|
|
1517
|
+
:attr str id: An identifier used to correlate this service in future requests to
|
|
1518
|
+
the broker. This MUST be globally unique within the IBM Cloud platform. It MUST
|
|
1519
|
+
be a non-empty string, and using a GUID is recommended. Recommended: If you
|
|
1520
|
+
define your service in the RMC, the RMC will generate a globally unique GUID
|
|
1521
|
+
service ID that you can use in your service broker.
|
|
1522
|
+
:attr str name: The service name is not your display name. Your service name
|
|
1523
|
+
must follow the follow these rules:
|
|
1524
|
+
- It must be all lowercase.
|
|
1525
|
+
- It can't include spaces but may include hyphens (`-`).
|
|
1526
|
+
- It must be less than 32 characters.
|
|
1527
|
+
Your service name should include your company name. If your company has more
|
|
1528
|
+
then one offering your service name should include both company and offering as
|
|
1529
|
+
part of the name. For example, the Compose company has offerings for Redis and
|
|
1530
|
+
Elasticsearch. Sample service names on IBM Cloud for these offerings would be
|
|
1531
|
+
`compose-redis` and `compose-elasticsearch`. Each of these service names have
|
|
1532
|
+
associated display names that are shown in the IBM Cloud catalog: *Compose
|
|
1533
|
+
Redis* and *Compose Elasticsearch*. Another company (e.g. FastJetMail) may only
|
|
1534
|
+
have the single JetMail offering, in which case the service name should be
|
|
1535
|
+
`fastjetmail`. Recommended: If you define your service in RMC, you can export a
|
|
1536
|
+
catalog.json that will include the service name you defined within the RMC.
|
|
1537
|
+
:attr bool plan_updateable: (optional) The Default is false. This specifices
|
|
1538
|
+
whether or not you support plan changes for provisioned instances. If your
|
|
1539
|
+
offering supports multiple plans, and you want users to be able to change plans
|
|
1540
|
+
for a provisioned instance, you will need to enable the ability for users to
|
|
1541
|
+
update their service instance by using /v2/service_instances/{instance_id}
|
|
1542
|
+
PATCH.
|
|
1543
|
+
:attr List[Plans] plans: A list of plans for this service that must contain at
|
|
1544
|
+
least one plan.
|
|
1545
|
+
"""
|
|
1546
|
+
|
|
1547
|
+
def __init__(
|
|
1548
|
+
self,
|
|
1549
|
+
bindable: bool,
|
|
1550
|
+
description: str,
|
|
1551
|
+
id: str,
|
|
1552
|
+
name: str,
|
|
1553
|
+
plans: List['Plans'],
|
|
1554
|
+
*,
|
|
1555
|
+
plan_updateable: bool = None,
|
|
1556
|
+
) -> None:
|
|
1557
|
+
"""
|
|
1558
|
+
Initialize a Services object.
|
|
1559
|
+
|
|
1560
|
+
:param bool bindable: Specifies whether or not your service can be bound to
|
|
1561
|
+
applications in IBM Cloud. If bindable, it must be able to return API
|
|
1562
|
+
endpoints and credentials to your service consumers.
|
|
1563
|
+
:param str description: A short description of the service. It MUST be a
|
|
1564
|
+
non-empty string. Note that this description is not displayed by the the
|
|
1565
|
+
IBM Cloud console or IBM Cloud CLI.
|
|
1566
|
+
:param str id: An identifier used to correlate this service in future
|
|
1567
|
+
requests to the broker. This MUST be globally unique within the IBM Cloud
|
|
1568
|
+
platform. It MUST be a non-empty string, and using a GUID is recommended.
|
|
1569
|
+
Recommended: If you define your service in the RMC, the RMC will generate a
|
|
1570
|
+
globally unique GUID service ID that you can use in your service broker.
|
|
1571
|
+
:param str name: The service name is not your display name. Your service
|
|
1572
|
+
name must follow the follow these rules:
|
|
1573
|
+
- It must be all lowercase.
|
|
1574
|
+
- It can't include spaces but may include hyphens (`-`).
|
|
1575
|
+
- It must be less than 32 characters.
|
|
1576
|
+
Your service name should include your company name. If your company has
|
|
1577
|
+
more then one offering your service name should include both company and
|
|
1578
|
+
offering as part of the name. For example, the Compose company has
|
|
1579
|
+
offerings for Redis and Elasticsearch. Sample service names on IBM Cloud
|
|
1580
|
+
for these offerings would be `compose-redis` and `compose-elasticsearch`.
|
|
1581
|
+
Each of these service names have associated display names that are shown in
|
|
1582
|
+
the IBM Cloud catalog: *Compose Redis* and *Compose Elasticsearch*. Another
|
|
1583
|
+
company (e.g. FastJetMail) may only have the single JetMail offering, in
|
|
1584
|
+
which case the service name should be `fastjetmail`. Recommended: If you
|
|
1585
|
+
define your service in RMC, you can export a catalog.json that will include
|
|
1586
|
+
the service name you defined within the RMC.
|
|
1587
|
+
:param List[Plans] plans: A list of plans for this service that must
|
|
1588
|
+
contain at least one plan.
|
|
1589
|
+
:param bool plan_updateable: (optional) The Default is false. This
|
|
1590
|
+
specifices whether or not you support plan changes for provisioned
|
|
1591
|
+
instances. If your offering supports multiple plans, and you want users to
|
|
1592
|
+
be able to change plans for a provisioned instance, you will need to enable
|
|
1593
|
+
the ability for users to update their service instance by using
|
|
1594
|
+
/v2/service_instances/{instance_id} PATCH.
|
|
1595
|
+
"""
|
|
1596
|
+
self.bindable = bindable
|
|
1597
|
+
self.description = description
|
|
1598
|
+
self.id = id
|
|
1599
|
+
self.name = name
|
|
1600
|
+
self.plan_updateable = plan_updateable
|
|
1601
|
+
self.plans = plans
|
|
1602
|
+
|
|
1603
|
+
@classmethod
|
|
1604
|
+
def from_dict(cls, _dict: Dict) -> 'Services':
|
|
1605
|
+
"""Initialize a Services object from a json dictionary."""
|
|
1606
|
+
args = {}
|
|
1607
|
+
if 'bindable' in _dict:
|
|
1608
|
+
args['bindable'] = _dict.get('bindable')
|
|
1609
|
+
else:
|
|
1610
|
+
raise ValueError('Required property \'bindable\' not present in Services JSON')
|
|
1611
|
+
if 'description' in _dict:
|
|
1612
|
+
args['description'] = _dict.get('description')
|
|
1613
|
+
else:
|
|
1614
|
+
raise ValueError('Required property \'description\' not present in Services JSON')
|
|
1615
|
+
if 'id' in _dict:
|
|
1616
|
+
args['id'] = _dict.get('id')
|
|
1617
|
+
else:
|
|
1618
|
+
raise ValueError('Required property \'id\' not present in Services JSON')
|
|
1619
|
+
if 'name' in _dict:
|
|
1620
|
+
args['name'] = _dict.get('name')
|
|
1621
|
+
else:
|
|
1622
|
+
raise ValueError('Required property \'name\' not present in Services JSON')
|
|
1623
|
+
if 'plan_updateable' in _dict:
|
|
1624
|
+
args['plan_updateable'] = _dict.get('plan_updateable')
|
|
1625
|
+
if 'plans' in _dict:
|
|
1626
|
+
args['plans'] = [Plans.from_dict(x) for x in _dict.get('plans')]
|
|
1627
|
+
else:
|
|
1628
|
+
raise ValueError('Required property \'plans\' not present in Services JSON')
|
|
1629
|
+
return cls(**args)
|
|
1630
|
+
|
|
1631
|
+
@classmethod
|
|
1632
|
+
def _from_dict(cls, _dict):
|
|
1633
|
+
"""Initialize a Services object from a json dictionary."""
|
|
1634
|
+
return cls.from_dict(_dict)
|
|
1635
|
+
|
|
1636
|
+
def to_dict(self) -> Dict:
|
|
1637
|
+
"""Return a json dictionary representing this model."""
|
|
1638
|
+
_dict = {}
|
|
1639
|
+
if hasattr(self, 'bindable') and self.bindable is not None:
|
|
1640
|
+
_dict['bindable'] = self.bindable
|
|
1641
|
+
if hasattr(self, 'description') and self.description is not None:
|
|
1642
|
+
_dict['description'] = self.description
|
|
1643
|
+
if hasattr(self, 'id') and self.id is not None:
|
|
1644
|
+
_dict['id'] = self.id
|
|
1645
|
+
if hasattr(self, 'name') and self.name is not None:
|
|
1646
|
+
_dict['name'] = self.name
|
|
1647
|
+
if hasattr(self, 'plan_updateable') and self.plan_updateable is not None:
|
|
1648
|
+
_dict['plan_updateable'] = self.plan_updateable
|
|
1649
|
+
if hasattr(self, 'plans') and self.plans is not None:
|
|
1650
|
+
_dict['plans'] = [x.to_dict() for x in self.plans]
|
|
1651
|
+
return _dict
|
|
1652
|
+
|
|
1653
|
+
def _to_dict(self):
|
|
1654
|
+
"""Return a json dictionary representing this model."""
|
|
1655
|
+
return self.to_dict()
|
|
1656
|
+
|
|
1657
|
+
def __str__(self) -> str:
|
|
1658
|
+
"""Return a `str` version of this Services object."""
|
|
1659
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
1660
|
+
|
|
1661
|
+
def __eq__(self, other: 'Services') -> bool:
|
|
1662
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
1663
|
+
if not isinstance(other, self.__class__):
|
|
1664
|
+
return False
|
|
1665
|
+
return self.__dict__ == other.__dict__
|
|
1666
|
+
|
|
1667
|
+
def __ne__(self, other: 'Services') -> bool:
|
|
1668
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
1669
|
+
return not self == other
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
class VolumeMount:
|
|
1673
|
+
"""
|
|
1674
|
+
VolumeMount.
|
|
1675
|
+
|
|
1676
|
+
:attr str driver: A free-form hash of credentials that can be used by
|
|
1677
|
+
applications or users to access the service.
|
|
1678
|
+
:attr str container_dir: The path in the application container onto which the
|
|
1679
|
+
volume will be mounted. This specification does not mandate what action the
|
|
1680
|
+
platform is to take if the path specified already exists in the container.
|
|
1681
|
+
:attr str mode: 'r' to mount the volume read-only or 'rw' to mount it
|
|
1682
|
+
read-write.
|
|
1683
|
+
:attr str device_type: A string specifying the type of device to mount.
|
|
1684
|
+
Currently the only supported value is 'shared'.
|
|
1685
|
+
:attr str device: Device object containing device_type specific details.
|
|
1686
|
+
Currently only shared devices are supported.
|
|
1687
|
+
"""
|
|
1688
|
+
|
|
1689
|
+
def __init__(self, driver: str, container_dir: str, mode: str, device_type: str, device: str) -> None:
|
|
1690
|
+
"""
|
|
1691
|
+
Initialize a VolumeMount object.
|
|
1692
|
+
|
|
1693
|
+
:param str driver: A free-form hash of credentials that can be used by
|
|
1694
|
+
applications or users to access the service.
|
|
1695
|
+
:param str container_dir: The path in the application container onto which
|
|
1696
|
+
the volume will be mounted. This specification does not mandate what action
|
|
1697
|
+
the platform is to take if the path specified already exists in the
|
|
1698
|
+
container.
|
|
1699
|
+
:param str mode: 'r' to mount the volume read-only or 'rw' to mount it
|
|
1700
|
+
read-write.
|
|
1701
|
+
:param str device_type: A string specifying the type of device to mount.
|
|
1702
|
+
Currently the only supported value is 'shared'.
|
|
1703
|
+
:param str device: Device object containing device_type specific details.
|
|
1704
|
+
Currently only shared devices are supported.
|
|
1705
|
+
"""
|
|
1706
|
+
self.driver = driver
|
|
1707
|
+
self.container_dir = container_dir
|
|
1708
|
+
self.mode = mode
|
|
1709
|
+
self.device_type = device_type
|
|
1710
|
+
self.device = device
|
|
1711
|
+
|
|
1712
|
+
@classmethod
|
|
1713
|
+
def from_dict(cls, _dict: Dict) -> 'VolumeMount':
|
|
1714
|
+
"""Initialize a VolumeMount object from a json dictionary."""
|
|
1715
|
+
args = {}
|
|
1716
|
+
if 'driver' in _dict:
|
|
1717
|
+
args['driver'] = _dict.get('driver')
|
|
1718
|
+
else:
|
|
1719
|
+
raise ValueError('Required property \'driver\' not present in VolumeMount JSON')
|
|
1720
|
+
if 'container_dir' in _dict:
|
|
1721
|
+
args['container_dir'] = _dict.get('container_dir')
|
|
1722
|
+
else:
|
|
1723
|
+
raise ValueError('Required property \'container_dir\' not present in VolumeMount JSON')
|
|
1724
|
+
if 'mode' in _dict:
|
|
1725
|
+
args['mode'] = _dict.get('mode')
|
|
1726
|
+
else:
|
|
1727
|
+
raise ValueError('Required property \'mode\' not present in VolumeMount JSON')
|
|
1728
|
+
if 'device_type' in _dict:
|
|
1729
|
+
args['device_type'] = _dict.get('device_type')
|
|
1730
|
+
else:
|
|
1731
|
+
raise ValueError('Required property \'device_type\' not present in VolumeMount JSON')
|
|
1732
|
+
if 'device' in _dict:
|
|
1733
|
+
args['device'] = _dict.get('device')
|
|
1734
|
+
else:
|
|
1735
|
+
raise ValueError('Required property \'device\' not present in VolumeMount JSON')
|
|
1736
|
+
return cls(**args)
|
|
1737
|
+
|
|
1738
|
+
@classmethod
|
|
1739
|
+
def _from_dict(cls, _dict):
|
|
1740
|
+
"""Initialize a VolumeMount object from a json dictionary."""
|
|
1741
|
+
return cls.from_dict(_dict)
|
|
1742
|
+
|
|
1743
|
+
def to_dict(self) -> Dict:
|
|
1744
|
+
"""Return a json dictionary representing this model."""
|
|
1745
|
+
_dict = {}
|
|
1746
|
+
if hasattr(self, 'driver') and self.driver is not None:
|
|
1747
|
+
_dict['driver'] = self.driver
|
|
1748
|
+
if hasattr(self, 'container_dir') and self.container_dir is not None:
|
|
1749
|
+
_dict['container_dir'] = self.container_dir
|
|
1750
|
+
if hasattr(self, 'mode') and self.mode is not None:
|
|
1751
|
+
_dict['mode'] = self.mode
|
|
1752
|
+
if hasattr(self, 'device_type') and self.device_type is not None:
|
|
1753
|
+
_dict['device_type'] = self.device_type
|
|
1754
|
+
if hasattr(self, 'device') and self.device is not None:
|
|
1755
|
+
_dict['device'] = self.device
|
|
1756
|
+
return _dict
|
|
1757
|
+
|
|
1758
|
+
def _to_dict(self):
|
|
1759
|
+
"""Return a json dictionary representing this model."""
|
|
1760
|
+
return self.to_dict()
|
|
1761
|
+
|
|
1762
|
+
def __str__(self) -> str:
|
|
1763
|
+
"""Return a `str` version of this VolumeMount object."""
|
|
1764
|
+
return json.dumps(self.to_dict(), indent=2)
|
|
1765
|
+
|
|
1766
|
+
def __eq__(self, other: 'VolumeMount') -> bool:
|
|
1767
|
+
"""Return `true` when self and other are equal, false otherwise."""
|
|
1768
|
+
if not isinstance(other, self.__class__):
|
|
1769
|
+
return False
|
|
1770
|
+
return self.__dict__ == other.__dict__
|
|
1771
|
+
|
|
1772
|
+
def __ne__(self, other: 'VolumeMount') -> bool:
|
|
1773
|
+
"""Return `true` when self and other are not equal, false otherwise."""
|
|
1774
|
+
return not self == other
|