COSClient Class¶
ibmcloudsql.cos
provides 3 classes
ibmcloudsql.cos.ParsedUrl
class that provides APIs to extract information from a given URL, for example from a COS URL.ibmcloudsql.cos.COSClient
class that does what ParsedUrl can and provides APIs to interact with COS (an extension to ibm-cos-sdk).ibmcloudsql.cos.ProjectLib
class that provides APIs to read/write data to a project’s COS.
Parsed URL¶
ParsedUrl
provides the APIs to parse a COS URL.
Project Lib¶
ProjectLib
class maintains a reference to an object in IBM Watson Studio’s ProjectLib
that can read a file stored as an asset and load them into the current notebook.
This file can be used in a number of scenarios, such as:
Store/reload progress information
Load external Python packages
Store/reload data files
Example:
When SQLQuery launches many jobs, there is a chance that the progress is stopped, and
you don’t want to restart from the beginning. The above setting enables the SQLQuery to skip the
completed sql queries. The file_name
argument is a reference to the name of the file that you can
use for saving and restoring the job progress.
from project_lib import Project
project = Project(project_id=your_project_id,
project_access_token=your_project_cos_acess_token)
# default file extension: json
file_name = "aiops"
sqlClient.connect_project_lib(project, file_name)
COS Client¶
COSClient
is also an IBMCloudAccess
and a ParsedUrl
.
COSClient class further provides the following APIs:
To interact with the COS instance:
To interact with the ProjectLib’s data: