diff --git a/.circleci/config.yml b/.circleci/config.yml index e62cae7b5c7b..cf659fa96181 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/Integrations/integration-Zscaler.yml b/Integrations/integration-Zscaler.yml index 3179f82da5ac..d95adc2d847e 100644 --- a/Integrations/integration-Zscaler.yml +++ b/Integrations/integration-Zscaler.yml @@ -47,12 +47,21 @@ 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, @@ -60,9 +69,8 @@ script: 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