Whitelist an IP Address using the New API version

Whitelisting IP addresses allows users of an account to log in only from certain (IPv4 or IPv6) addresses.

Note

Contact Qubole Support to enable whitelisting for an account. Keep in mind that once whitelisting is enabled, users of the account can log in only from a whitelisted address.

Required Role

To make this API call you must:

  • Belong to the system-user or system-admin group.
  • Belong to a group associated with a role that allows editing an account. See Managing Groups and Managing Roles for more information.

Add a Whitelisted IP Address

POST /api/v2/accounts/whitelist_ip

Parameter

Note

Parameters marked in bold below are mandatory. Others are optional and have default values.

Parameter Description
ip_cidr IP address to be whitelisted, in IPv4 or IPv6 format
description You can now add a description related to the IP address that you whitelist. The description can only contain a maximum of 255 characters.

Example

Request:

curl -X POST -H "X-AUTH-TOKEN: $X_AUTH_TOKEN" -H "Content-Type:application/json" -H "Accept: application/json" \
-d '{"ip_cidr" : "103.252.24.87"}' \ "https://api.qubole.com/api/v2/accounts/whitelist_ip"

Note

The above example 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.

Response:

{"status":{"status_code":200,"message":"IP whitelisted successfully."}}

List Whitelisted IP Addresses

GET /api/v2/accounts/whitelist_ip

Example

Request:

curl -X GET -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type:application/json" -H "Accept: application/json" \
"https://api.qubole.com/api/v2/accounts/whitelist_ip"

Note

The above example 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.

Response:

An array of hashes containing account ID and IP address info; for example:

{"account_whitelisted_ips":[{"account_id":1,"created_at":"2017-01-17T19:06:56Z","id":1,"ip_cidr":"103.252.24.92","updated_at":"2017-01-17T19:06:56Z"},{"account_id":1,"created_at":"2017-01-17T19:07:20Z","id":2,"ip_cidr":"103.252.24.91","updated_at":"2017-01-17T19:07:20Z"}]}

Delete One or More Whitelisted IP Addresses

DELETE /api/v2/accounts/whitelist_ip/<id>

where <id> is the ID of the whitelisted IP address. To delete multiple addresses, use a comma-separated list of IDs.

Example

Request:

curl -X DELETE -H "X-AUTH-TOKEN:  $X_AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
"https://api.qubole.com/api/v2/accounts/whitelist_ip/1,2"

Note

The above example 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.

Response

{"status":{"status_code":200,"message":"Deleted"}}