Whitelist an IP Address¶
Note
A new version is available for this api. The current version will be deprecated soon. See 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
Send an email request to help@qubole.com 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.
- Add a Whitelisted IP Address
- List Whitelisted IP Addresses
- Delete One or More Whitelisted IP Addresses
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/v1.2/whitelist_ip¶
Parameter¶
| Parameter | Description |
|---|---|
| ip_cidr | IP address to be whitelisted, in IPv4 or IPv6 format |
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/v1.2/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/v1.2/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/v1.2/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/v1.2/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/v1.2/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"}}