|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Pure1 Public REST API |
| 5 | +
|
| 6 | + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) |
| 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 | +from typing import List, Optional |
| 21 | + |
| 22 | +from .. import models |
| 23 | + |
| 24 | +class DirectoriesApi(object): |
| 25 | + |
| 26 | + def __init__(self, api_client): |
| 27 | + self.api_client = api_client |
| 28 | + |
| 29 | + def api10_directories_get_with_http_info( |
| 30 | + self, |
| 31 | + authorization=None, # type: str |
| 32 | + x_request_id=None, # type: str |
| 33 | + continuation_token=None, # type: str |
| 34 | + file_system_ids=None, # type: List[str] |
| 35 | + file_system_names=None, # type: List[str] |
| 36 | + filter=None, # type: str |
| 37 | + ids=None, # type: List[str] |
| 38 | + limit=None, # type: int |
| 39 | + names=None, # type: List[str] |
| 40 | + offset=None, # type: int |
| 41 | + sort=None, # type: List[str] |
| 42 | + async_req=False, # type: bool |
| 43 | + _return_http_data_only=False, # type: bool |
| 44 | + _preload_content=True, # type: bool |
| 45 | + _request_timeout=None, # type: Optional[int] |
| 46 | + ): |
| 47 | + # type: (...) -> models.DirectoryGetResponse |
| 48 | + """Get managed directories |
| 49 | +
|
| 50 | + Retrieves information about FlashArray managed directory objects. |
| 51 | + This method makes a synchronous HTTP request by default. To make an |
| 52 | + asynchronous HTTP request, please pass async_req=True |
| 53 | + >>> thread = api.api10_directories_get_with_http_info(async_req=True) |
| 54 | + >>> result = thread.get() |
| 55 | +
|
| 56 | + :param str authorization: Access token (in JWT format) required to use any API endpoint (except `/oauth2`) |
| 57 | + :param str x_request_id: Supplied by client during request or generated by server. |
| 58 | + :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. |
| 59 | + :param list[str] file_system_ids: Performs the operation on the file system ID specified. Enter multiple file system IDs in comma-separated format. The `file_system_ids` and `file_system_names` parameters cannot be provided together. Single quotes are required around all strings. |
| 60 | + :param list[str] file_system_names: Performs the operation on the file system name specified. Enter multiple file system names in comma-separated format. For example, `filesystem1,filesystem2`. The `file_system_ids` and `file_system_names` parameters cannot be provided together. Single quotes are required around all strings. |
| 61 | + :param str filter: Exclude resources that don't match the specified criteria. Single quotes are required around all strings inside the filters. |
| 62 | + :param list[str] ids: A comma-separated list of resource IDs. If there is not at least one resource that matches each `id` element, an error is returned. Single quotes are required around all strings. |
| 63 | + :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. |
| 64 | + :param list[str] names: A comma-separated list of resource names. If there is not at least one resource that matches each `name` element, an error is returned. Single quotes are required around all strings. |
| 65 | + :param int offset: The offset of the first resource to return from a collection. |
| 66 | + :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. |
| 67 | + :param bool async_req: Request runs in separate thread and method returns multiprocessing.pool.ApplyResult. |
| 68 | + :param bool _return_http_data_only: Returns only data field. |
| 69 | + :param bool _preload_content: Response is converted into objects. |
| 70 | + :param int _request_timeout: Total request timeout in seconds. |
| 71 | + It can also be a tuple of (connection time, read time) timeouts. |
| 72 | + :return: DirectoryGetResponse |
| 73 | + If the method is called asynchronously, |
| 74 | + returns the request thread. |
| 75 | + """ |
| 76 | + continuation_token = models.quoteString(continuation_token) |
| 77 | + if file_system_ids is not None: |
| 78 | + if not isinstance(file_system_ids, list): |
| 79 | + file_system_ids = [file_system_ids] |
| 80 | + if file_system_names is not None: |
| 81 | + if not isinstance(file_system_names, list): |
| 82 | + file_system_names = [file_system_names] |
| 83 | + if ids is not None: |
| 84 | + if not isinstance(ids, list): |
| 85 | + ids = [ids] |
| 86 | + ids = models.quoteStrings(ids) |
| 87 | + if names is not None: |
| 88 | + if not isinstance(names, list): |
| 89 | + names = [names] |
| 90 | + names = models.quoteStrings(names) |
| 91 | + if sort is not None: |
| 92 | + if not isinstance(sort, list): |
| 93 | + sort = [sort] |
| 94 | + params = {k: v for k, v in six.iteritems(locals()) if v is not None} |
| 95 | + |
| 96 | + # Convert the filter into a string |
| 97 | + if params.get('filter'): |
| 98 | + params['filter'] = str(params['filter']) |
| 99 | + if params.get('sort'): |
| 100 | + params['sort'] = [str(_x) for _x in params['sort']] |
| 101 | + |
| 102 | + if 'offset' in params and params['offset'] < 0: |
| 103 | + raise ValueError("Invalid value for parameter `offset` when calling `api10_directories_get`, must be a value greater than or equal to `0`") |
| 104 | + collection_formats = {} |
| 105 | + path_params = {} |
| 106 | + |
| 107 | + query_params = [] |
| 108 | + if 'continuation_token' in params: |
| 109 | + query_params.append(('continuation_token', params['continuation_token'])) |
| 110 | + if 'file_system_ids' in params: |
| 111 | + query_params.append(('file_system_ids', params['file_system_ids'])) |
| 112 | + collection_formats['file_system_ids'] = 'csv' |
| 113 | + if 'file_system_names' in params: |
| 114 | + query_params.append(('file_system_names', params['file_system_names'])) |
| 115 | + collection_formats['file_system_names'] = 'csv' |
| 116 | + if 'filter' in params: |
| 117 | + query_params.append(('filter', params['filter'])) |
| 118 | + if 'ids' in params: |
| 119 | + query_params.append(('ids', params['ids'])) |
| 120 | + collection_formats['ids'] = 'csv' |
| 121 | + if 'limit' in params: |
| 122 | + query_params.append(('limit', params['limit'])) |
| 123 | + if 'names' in params: |
| 124 | + query_params.append(('names', params['names'])) |
| 125 | + collection_formats['names'] = 'csv' |
| 126 | + if 'offset' in params: |
| 127 | + query_params.append(('offset', params['offset'])) |
| 128 | + if 'sort' in params: |
| 129 | + query_params.append(('sort', params['sort'])) |
| 130 | + collection_formats['sort'] = 'csv' |
| 131 | + |
| 132 | + header_params = {} |
| 133 | + if 'authorization' in params: |
| 134 | + header_params['Authorization'] = params['authorization'] |
| 135 | + if 'x_request_id' in params: |
| 136 | + header_params['X-Request-ID'] = params['x_request_id'] |
| 137 | + |
| 138 | + form_params = [] |
| 139 | + local_var_files = {} |
| 140 | + |
| 141 | + body_params = None |
| 142 | + # HTTP header `Accept` |
| 143 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 144 | + ['application/json']) |
| 145 | + |
| 146 | + # HTTP header `Content-Type` |
| 147 | + header_params['Content-Type'] = self.api_client.select_header_content_type( |
| 148 | + ['application/json']) |
| 149 | + |
| 150 | + # Authentication setting |
| 151 | + auth_settings = ['AuthorizationHeader'] |
| 152 | + |
| 153 | + return self.api_client.call_api( |
| 154 | + '/api/1.0/directories', 'GET', |
| 155 | + path_params, |
| 156 | + query_params, |
| 157 | + header_params, |
| 158 | + body=body_params, |
| 159 | + post_params=form_params, |
| 160 | + files=local_var_files, |
| 161 | + response_type='DirectoryGetResponse', |
| 162 | + auth_settings=auth_settings, |
| 163 | + async_req=async_req, |
| 164 | + _return_http_data_only=_return_http_data_only, |
| 165 | + _preload_content=_preload_content, |
| 166 | + _request_timeout=_request_timeout, |
| 167 | + collection_formats=collection_formats, |
| 168 | + ) |
0 commit comments