Remove Packages from a Package Management Environment

DELETE /api/v1.2/package/<env ID>/remove_packages

Use this API to remove Python and R packages from a Package Management environment.

Required Role

The following users can make this API call:

  • Users who belong to the system-admin or system-user 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
source_type Specify python_package or r_package and it is mandatory while removing packages from an environment.
package_names Specify the name of the package. To remove a specific version of the package, specify it in this format: <packagename>==<version-number>. For example, biopython==0.1. You can remove any number of packages as a comma-separated list.

Request API Syntax

curl -X DELETE -H "X-AUTH-TOKEN: <API-TOKEN>" -H "Content-Type: application/json" -H "Accept: application/json"
-d ' {"source_type": "<package type>", "package_names": "<packagename1>,<packagename2>,....,<packagenameN>"}
      "https://gcp.qubole.com/api/v1.2/package/<envID>/remove_packages"

Sample API Request

Here is a sample API call for removing Python packages from an environment that has 120 as its ID.

curl -X DELETE -H "X-AUTH-TOKEN: <API-TOKEN>" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"source_type": "python_package", "package_names": "numpy,bipython==0.1,tensorflow"}' \
     "https://gcp.qubole.com/api/v1.2/package/120/remove_packages"

Here is a sample API call for removing R packages from an environment that has 120 as its ID.

curl -X DELETE -H "X-AUTH-TOKEN: <API-TOKEN>" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"source_type": "r_package", "package_names": "r-rserve,r-brew==1.0"}' \
     "https://gcp.qubole.com/api/v1.2/package/120/remove_packages"