Modify Channels in Package Management
- PUT /api/v1.2/package/<envId>/modify_channels
Use this API to modify the channels for Conda, PyPI and CRAN to install packages from the custom channels.
Note
This API is available in the new Package Management and is not enabled by default. Create a ticket with Qubole Support to enable this API.
Required Role
The following users can make this API call:
Users who belong to the system-user or system-admin group.
Users who belong to a group associated with a role that allows updating an environment. See Managing Groups and Managing Roles for more information.
Parameters
Note
Parameters marked in bold are mandatory. Others are optional and have default values.
Parameter |
Description |
---|---|
channel_type |
Type of channel. Valid values are
|
list |
Specify the channels you want to set for the The following values are the default channel list for the channel types: {"py_conda" => "defaults,conda-forge",
"pip" => "https://pypi.python.org/simple",
"r_conda" => "defaults,conda-forge",
"cran" => "https://cran.r-project.org/“}
|
Request API Syntax
curl -X PUT -H "X-AUTH-TOKEN:<API-TOKEN>“ -H "Content-Type: application/json" -H "Accept: application/json"
-d ' {"channel_type": “<channel type>“, "list": “<channel1>,,<channel2>,<channel3>“}’ \
"https://api.qubole.com/api/v1.2/package/<envId>/modify_channels"
Note
The above syntax uses https://api.qubole.com as the endpoint. Qubole provides other endpoints to access QDS that are described in Supported Qubole Endpoints on Different Cloud Providers.
Sample API Request
The following example shows how to modify the channels for the Python Conda environment.
curl -X PUT -H "X-AUTH-TOKEN:<API-TOKEN>“ -H "Content-Type: application/json" -H "Accept: application/json"
-d ' {"channel_type": "py_conda", "list": "defaults,bioconda,conda-forge"}' \
"https://api.qubole.com/api/v1.2/package/100/modify_channels"
The following example shows how to modify the channels for the R Conda environment.
curl -X PUT -H "X-AUTH-TOKEN:<API-TOKEN>“ -H "Content-Type: application/json" -H "Accept: application/json"
-d ' {"channel_type": “r_conda", "list": "defaults,bioconda,r,conda-forge"}' \
"https://api.qubole.net/api/v1.2/package/100/modify_channels"
The following example shows how to modify the channels for PyPI.
curl -X PUT -H "X-AUTH-TOKEN:<API-TOKEN>“ -H "Content-Type: application/json" -H "Accept: application/json"
-d ' {"channel_type": “pip”, "list": "https://pypi.python.org/simple”}’ \
"https://api.qubole.com/api/v1.2/package/100/modify_channels"
The following example shows how to modify the channels for the CRAN environment.
curl -X PUT -H "X-AUTH-TOKEN:<API-TOKEN>“ -H "Content-Type: application/json" -H "Accept: application/json"
-d ' {"channel_type": “cran”, "list": "https://cran.r-project.org, https://cloud.r-project.org/”}’ \
"https://api.qubole.com/api/v1.2/package/100/modify_channels"