Skip to content

Commit

Permalink
18.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Itay4 committed Sep 6, 2018
1 parent dddb220 commit 362bd84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
docker:
- image: circleci/node:9.11
environment:
CONTENT_VERSION: "18.9.0"
CONTENT_VERSION: "18.9.1"
steps:
- checkout
- run:
Expand Down
18 changes: 13 additions & 5 deletions Integrations/integration-Zscaler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,30 @@ script:
DEFAULT_HEADERS = {
'content-type': 'application/json'
}
ERROR_CODES_DICT = {
400: 'Invalid or bad request',
401: 'Session is not authenticated or timed out',
403: 'One of the following permission errors occurred:\n-The API key was disabled by your service provider\n-User role has no access permissions or functional scope\n-A required SKU subscription is missing\nContact support or your account team for assistance.',
404: 'Resource does not exist',
409: 'Request could not be processed because of possible edit conflict occurred. Another admin might be saving a configuration change at the same time. In this scenario, the client is expected to retry after a short time period.',
415: 'Unsupported media type.',
429: 'Exceeded the rate limit or quota.',
500: 'Unexpected error',
503: 'Service is temporarily unavailable'
}
''' HELPER FUNCTIONS '''
def http_request(method, url_suffix, data=None, headers=DEFAULT_HEADERS):
data = {} if data is None else data
LOG('running request with url=%s\tdata=%s\theaders=%s' % (BASE_URL + url_suffix,
data, headers))
LOG('running request with url=%s\theaders=%s' % (BASE_URL + url_suffix, headers))
try:
res = requests.request(method,
BASE_URL + url_suffix,
verify=USE_SSL,
data=data,
headers=headers
)
if res.status_code not in (200, 204):
raise Exception('Your request failed with the following error: ' + res.reason)
raise Exception('Your request failed with the following error: ' + ERROR_CODES_DICT[res.status_code])
except Exception, e:
LOG(e)
raise
Expand Down

0 comments on commit 362bd84

Please sign in to comment.