You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
7.4 KiB

2 years ago
  1. # openapi_client.DefaultApi
  2. All URIs are relative to *https://127.0.0.1:9333*
  3. Method | HTTP request | Description
  4. ------------- | ------------- | -------------
  5. [**dir_assign**](DefaultApi.md#dir_assign) | **GET** /dir/assign | Assign a file key
  6. [**dir_lookup**](DefaultApi.md#dir_lookup) | **GET** /dir/lookup | Lookup volume
  7. # **dir_assign**
  8. > FileKey dir_assign(count=count, collection=collection, data_center=data_center, rack=rack, data_node=data_node, disk=disk, replication=replication, ttl=ttl, preallocate=preallocate, memory_map_max_size_mb=memory_map_max_size_mb, writable_volume_count=writable_volume_count)
  9. Assign a file key
  10. This operation is very cheap. Just increase a number in master server's memory.
  11. ### Example
  12. ```python
  13. from __future__ import print_function
  14. import time
  15. import os
  16. import openapi_client
  17. from openapi_client.rest import ApiException
  18. from pprint import pprint
  19. # Defining the host is optional and defaults to https://127.0.0.1:9333
  20. # See configuration.py for a list of all supported configuration parameters.
  21. configuration = openapi_client.Configuration(
  22. host = "https://127.0.0.1:9333"
  23. )
  24. # Enter a context with an instance of the API client
  25. with openapi_client.ApiClient(configuration) as api_client:
  26. # Create an instance of the API class
  27. api_instance = openapi_client.DefaultApi(api_client)
  28. count = None # object | how many file ids to assign. Use <fid>_1, <fid>_2 for the assigned additional file ids. e.g. 3,01637037d6_1, 3,01637037d6_2 (optional)
  29. collection = None # object | required collection name (optional)
  30. data_center = None # object | preferred data center (optional)
  31. rack = None # object | preferred rack (optional)
  32. data_node = None # object | preferred volume server, e.g. 127.0.0.1:8080 (optional)
  33. disk = None # object | If you have disks labelled, this must be supplied to specify the disk type to allocate on. (optional)
  34. replication = None # object | replica placement strategy (optional)
  35. ttl = None # object | file expiration time limit, example: 3m for 3 minutes. units: m-minute, h-hour, d-day, w-week, M-month, y-year (optional)
  36. preallocate = None # object | If no matching volumes, pre-allocate this number of bytes on disk for new volumes. (optional)
  37. memory_map_max_size_mb = None # object | Only implemented for windows. Use memory mapped files with specified size for new volumes. (optional)
  38. writable_volume_count = None # object | If no matching volumes, create specified number of new volumes. (optional)
  39. try:
  40. # Assign a file key
  41. api_response = api_instance.dir_assign(count=count, collection=collection, data_center=data_center, rack=rack, data_node=data_node, disk=disk, replication=replication, ttl=ttl, preallocate=preallocate, memory_map_max_size_mb=memory_map_max_size_mb, writable_volume_count=writable_volume_count)
  42. print("The response of DefaultApi->dir_assign:\n")
  43. pprint(api_response)
  44. except Exception as e:
  45. print("Exception when calling DefaultApi->dir_assign: %s\n" % e)
  46. ```
  47. ### Parameters
  48. Name | Type | Description | Notes
  49. ------------- | ------------- | ------------- | -------------
  50. **count** | [**object**](.md)| how many file ids to assign. Use &lt;fid&gt;_1, &lt;fid&gt;_2 for the assigned additional file ids. e.g. 3,01637037d6_1, 3,01637037d6_2 | [optional]
  51. **collection** | [**object**](.md)| required collection name | [optional]
  52. **data_center** | [**object**](.md)| preferred data center | [optional]
  53. **rack** | [**object**](.md)| preferred rack | [optional]
  54. **data_node** | [**object**](.md)| preferred volume server, e.g. 127.0.0.1:8080 | [optional]
  55. **disk** | [**object**](.md)| If you have disks labelled, this must be supplied to specify the disk type to allocate on. | [optional]
  56. **replication** | [**object**](.md)| replica placement strategy | [optional]
  57. **ttl** | [**object**](.md)| file expiration time limit, example: 3m for 3 minutes. units: m-minute, h-hour, d-day, w-week, M-month, y-year | [optional]
  58. **preallocate** | [**object**](.md)| If no matching volumes, pre-allocate this number of bytes on disk for new volumes. | [optional]
  59. **memory_map_max_size_mb** | [**object**](.md)| Only implemented for windows. Use memory mapped files with specified size for new volumes. | [optional]
  60. **writable_volume_count** | [**object**](.md)| If no matching volumes, create specified number of new volumes. | [optional]
  61. ### Return type
  62. [**FileKey**](FileKey.md)
  63. ### Authorization
  64. No authorization required
  65. ### HTTP request headers
  66. - **Content-Type**: Not defined
  67. - **Accept**: application/json
  68. ### HTTP response details
  69. | Status code | Description | Response headers |
  70. |-------------|-------------|------------------|
  71. **200** | successful operation | - |
  72. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
  73. # **dir_lookup**
  74. > object dir_lookup(volume_id=volume_id, collection=collection, file_id=file_id, read=read)
  75. Lookup volume
  76. We would need to find out whether the volumes have moved.
  77. ### Example
  78. ```python
  79. from __future__ import print_function
  80. import time
  81. import os
  82. import openapi_client
  83. from openapi_client.rest import ApiException
  84. from pprint import pprint
  85. # Defining the host is optional and defaults to https://127.0.0.1:9333
  86. # See configuration.py for a list of all supported configuration parameters.
  87. configuration = openapi_client.Configuration(
  88. host = "https://127.0.0.1:9333"
  89. )
  90. # Enter a context with an instance of the API client
  91. with openapi_client.ApiClient(configuration) as api_client:
  92. # Create an instance of the API class
  93. api_instance = openapi_client.DefaultApi(api_client)
  94. volume_id = None # object | volume id (optional)
  95. collection = None # object | optionally to speed up the lookup (optional)
  96. file_id = None # object | If provided, this returns the fileId location and a JWT to update or delete the file. (optional)
  97. read = None # object | works together with \"fileId\", if read=yes, JWT is generated for reads. (optional)
  98. try:
  99. # Lookup volume
  100. api_response = api_instance.dir_lookup(volume_id=volume_id, collection=collection, file_id=file_id, read=read)
  101. print("The response of DefaultApi->dir_lookup:\n")
  102. pprint(api_response)
  103. except Exception as e:
  104. print("Exception when calling DefaultApi->dir_lookup: %s\n" % e)
  105. ```
  106. ### Parameters
  107. Name | Type | Description | Notes
  108. ------------- | ------------- | ------------- | -------------
  109. **volume_id** | [**object**](.md)| volume id | [optional]
  110. **collection** | [**object**](.md)| optionally to speed up the lookup | [optional]
  111. **file_id** | [**object**](.md)| If provided, this returns the fileId location and a JWT to update or delete the file. | [optional]
  112. **read** | [**object**](.md)| works together with \&quot;fileId\&quot;, if read&#x3D;yes, JWT is generated for reads. | [optional]
  113. ### Return type
  114. **object**
  115. ### Authorization
  116. No authorization required
  117. ### HTTP request headers
  118. - **Content-Type**: Not defined
  119. - **Accept**: application/json
  120. ### HTTP response details
  121. | Status code | Description | Response headers |
  122. |-------------|-------------|------------------|
  123. **200** | successful operation | - |
  124. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)