|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Pure1 Public REST API |
| 5 | +
|
| 6 | + Pure1 Public REST API, developed by [Pure Storage, Inc.](http://www.purestorage.com/) [Knowledge base reference documentation](https://support.purestorage.com/Pure1/Pure1_Manage/Pure1_Manage_-_REST_API/Pure1_Manage_-_REST_API__Reference) |
| 7 | +
|
| 8 | + OpenAPI spec version: 1.0 |
| 9 | + |
| 10 | + Generated by: https://github.com/swagger-api/swagger-codegen.git |
| 11 | +""" |
| 12 | + |
| 13 | + |
| 14 | +from __future__ import absolute_import |
| 15 | + |
| 16 | +import re |
| 17 | + |
| 18 | +# python 2 and python 3 compatibility library |
| 19 | +import six |
| 20 | + |
| 21 | +from pypureclient.pure1.api_client import ApiClient |
| 22 | + |
| 23 | + |
| 24 | +class AlertsApi(object): |
| 25 | + """NOTE: This class is auto generated by the swagger code generator program. |
| 26 | +
|
| 27 | + Do not edit the class manually. |
| 28 | + Ref: https://github.com/swagger-api/swagger-codegen |
| 29 | + """ |
| 30 | + |
| 31 | + def __init__(self, api_client=None): |
| 32 | + if api_client is None: |
| 33 | + api_client = ApiClient() |
| 34 | + self.api_client = api_client |
| 35 | + |
| 36 | + def api10_alerts_get(self, **kwargs): |
| 37 | + """api10_alerts_get |
| 38 | +
|
| 39 | + Get alert objects. |
| 40 | + This method makes a synchronous HTTP request by default. To make an |
| 41 | + asynchronous HTTP request, please pass async_req=True |
| 42 | + >>> thread = api.api10_alerts_get(async_req=True) |
| 43 | + >>> result = thread.get() |
| 44 | +
|
| 45 | + :param async_req bool |
| 46 | + :param str authorization: REQUIRED normally; do not use if authenticating with the \"Try it out\" feature. Access JWT required to use any API endpoint. |
| 47 | + :param str x_request_id: Supplied by client during request or generated by server. |
| 48 | + :param str continuation_token: An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. |
| 49 | + :param str filter: Exclude resources that don't match the specified criteria. Single quotes are required around all strings inside the filters. |
| 50 | + :param list[str] ids: A comma-separated list of resource IDs. If there is not at least one resource that matches each of the elements of ids, an error is returned. Single quotes are required around all strings. |
| 51 | + :param int limit: Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client's page size request. If not specified, defaults to 1000. |
| 52 | + :param list[str] names: A comma-separated list of resource names. If there is not at least one resource that matches each of the elements of names, an error is returned. Single quotes are required around all strings. |
| 53 | + :param int offset: The offset of the first resource to return from a collection. |
| 54 | + :param list[str] sort: Sort the response by the specified fields (in descending order if '-' is appended to the field name). If you provide a sort you will not get a continuation token in the response. |
| 55 | + :return: AlertsGet |
| 56 | + If the method is called asynchronously, |
| 57 | + returns the request thread. |
| 58 | + """ |
| 59 | + kwargs['_return_http_data_only'] = True |
| 60 | + if kwargs.get('async_req'): |
| 61 | + return self.api10_alerts_get_with_http_info(**kwargs) |
| 62 | + else: |
| 63 | + (data) = self.api10_alerts_get_with_http_info(**kwargs) |
| 64 | + return data |
| 65 | + |
| 66 | + def api10_alerts_get_with_http_info(self, **kwargs): |
| 67 | + """api10_alerts_get |
| 68 | +
|
| 69 | + Get alert objects. |
| 70 | + This method makes a synchronous HTTP request by default. To make an |
| 71 | + asynchronous HTTP request, please pass async_req=True |
| 72 | + >>> thread = api.api10_alerts_get_with_http_info(async_req=True) |
| 73 | + >>> result = thread.get() |
| 74 | +
|
| 75 | + :param async_req bool |
| 76 | + :param str authorization: REQUIRED normally; do not use if authenticating with the \"Try it out\" feature. Access JWT required to use any API endpoint. |
| 77 | + :param str x_request_id: Supplied by client during request or generated by server. |
| 78 | + :param str continuation_token: An opaque token used to iterate over a collection. The token to use on the next request is returned in the continuation_token field of the result. Single quotes are required around all strings. |
| 79 | + :param str filter: Exclude resources that don't match the specified criteria. Single quotes are required around all strings inside the filters. |
| 80 | + :param list[str] ids: A comma-separated list of resource IDs. If there is not at least one resource that matches each of the elements of ids, an error is returned. Single quotes are required around all strings. |
| 81 | + :param int limit: Limit the size of the response to the specified number of resources. A limit of 0 can be used to get the number of resources without getting all of the resources. It will be returned in the total_item_count field. If a client asks for a page size larger than the maximum number, the request is still valid. In that case the server just returns the maximum number of items, disregarding the client's page size request. If not specified, defaults to 1000. |
| 82 | + :param list[str] names: A comma-separated list of resource names. If there is not at least one resource that matches each of the elements of names, an error is returned. Single quotes are required around all strings. |
| 83 | + :param int offset: The offset of the first resource to return from a collection. |
| 84 | + :param list[str] sort: Sort the response by the specified fields (in descending order if '-' is appended to the field name). If you provide a sort you will not get a continuation token in the response. |
| 85 | + :return: AlertsGet |
| 86 | + If the method is called asynchronously, |
| 87 | + returns the request thread. |
| 88 | + """ |
| 89 | + |
| 90 | + all_params = ['authorization', 'x_request_id', 'continuation_token', 'filter', 'ids', 'limit', 'names', 'offset', 'sort'] |
| 91 | + all_params.append('async_req') |
| 92 | + all_params.append('_return_http_data_only') |
| 93 | + all_params.append('_preload_content') |
| 94 | + all_params.append('_request_timeout') |
| 95 | + |
| 96 | + params = locals() |
| 97 | + for key, val in six.iteritems(params['kwargs']): |
| 98 | + if key not in all_params: |
| 99 | + raise TypeError( |
| 100 | + "Got an unexpected keyword argument '%s'" |
| 101 | + " to method api10_alerts_get" % key |
| 102 | + ) |
| 103 | + params[key] = val |
| 104 | + del params['kwargs'] |
| 105 | + |
| 106 | + if 'offset' in params and params['offset'] < 0: |
| 107 | + raise ValueError("Invalid value for parameter `offset` when calling `api10_alerts_get`, must be a value greater than or equal to `0`") |
| 108 | + collection_formats = {} |
| 109 | + |
| 110 | + path_params = {} |
| 111 | + |
| 112 | + query_params = [] |
| 113 | + if 'continuation_token' in params: |
| 114 | + query_params.append(('continuation_token', params['continuation_token'])) |
| 115 | + if 'filter' in params: |
| 116 | + query_params.append(('filter', params['filter'])) |
| 117 | + if 'ids' in params: |
| 118 | + query_params.append(('ids', params['ids'])) |
| 119 | + collection_formats['ids'] = 'multi' |
| 120 | + if 'limit' in params: |
| 121 | + query_params.append(('limit', params['limit'])) |
| 122 | + if 'names' in params: |
| 123 | + query_params.append(('names', params['names'])) |
| 124 | + collection_formats['names'] = 'multi' |
| 125 | + if 'offset' in params: |
| 126 | + query_params.append(('offset', params['offset'])) |
| 127 | + if 'sort' in params: |
| 128 | + query_params.append(('sort', params['sort'])) |
| 129 | + collection_formats['sort'] = 'multi' |
| 130 | + |
| 131 | + header_params = {} |
| 132 | + if 'authorization' in params: |
| 133 | + header_params['Authorization'] = params['authorization'] |
| 134 | + if 'x_request_id' in params: |
| 135 | + header_params['X-Request-ID'] = params['x_request_id'] |
| 136 | + |
| 137 | + form_params = [] |
| 138 | + local_var_files = {} |
| 139 | + |
| 140 | + body_params = None |
| 141 | + # HTTP header `Accept` |
| 142 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 143 | + ['application/json']) |
| 144 | + |
| 145 | + # HTTP header `Content-Type` |
| 146 | + header_params['Content-Type'] = self.api_client.select_header_content_type( |
| 147 | + ['application/json']) |
| 148 | + |
| 149 | + # Authentication setting |
| 150 | + auth_settings = ['AuthorizationHeader'] |
| 151 | + |
| 152 | + return self.api_client.call_api( |
| 153 | + '/api/1.0/alerts', 'GET', |
| 154 | + path_params, |
| 155 | + query_params, |
| 156 | + header_params, |
| 157 | + body=body_params, |
| 158 | + post_params=form_params, |
| 159 | + files=local_var_files, |
| 160 | + response_type='AlertsGet', |
| 161 | + auth_settings=auth_settings, |
| 162 | + async_req=params.get('async_req'), |
| 163 | + _return_http_data_only=params.get('_return_http_data_only'), |
| 164 | + _preload_content=params.get('_preload_content', True), |
| 165 | + _request_timeout=params.get('_request_timeout'), |
| 166 | + collection_formats=collection_formats) |
0 commit comments