Path: blob/main/L4assets/DSandMLOpsAssets/CLIandSDK/Notebooks/CPDaaS-04 Services.ipynb
1928 views
Cloud Pak for Data as a Service services management
Make sure to set the API_key variable in the next cell before executing it
This notebook covers:
Get a partial list of the services in the catalog
List the services (resources) in the account
Create a service
Adding a service to the current project
Removing the service from the project
Deleting the service
References:
Support functions
instructions:
Select the next empty cell as the current cell
From the code snipet '</>' tab on the right, use
Read data,Select data from projectThen click on
Data asset, and finally oncpdalllibs.zipMake sure the "Load as" selection is set to
StreamingBody object, and click onInsert code to cellMake sure the inserted code references 'streaming_body_1' in a line like:
streaming_body_1 = cos_client.get_object(Bucket=bucket, Key=object_key)['Body']
Get an access token
Get a partial list of the services in the catalog
To get a list of all services, we could use a library but since we're not going deep into the catalog entries,it does not save us any work. Here is how we can do the same as above using the library:
We can get a maximum of 200 entries for each call. If we expect more, we need to loop using the offset parameter. Using the library, the code would be:
List one complete entry
List the services (resources) in the account
Create a service
Display a summary of the available plans
Get available resource groups
There is at least the "default" group
Create the service
Adding a service to the current project
Listing the project services
Removing the language translator service
Remove the service from the project
Delete the service IDs and the service
Delete the service
Remove the service from the project
Removing is like adding a list minus the elements we remove
Delete the service
Author
Jacques Roy is a member of the IBM Enablement for Data and AI
Copyright © 2023. This notebook and its source code are released under the terms of the MIT License.